Special Query


Generating conditions find_in_set(1, name)

? represents parameter binding. You can write the conditions directly. The second parameter is not passed, but you need to pay attention to prevent injection risk

$data = Model::create()->where("find_in_set(?, name)", [1])->get();

complex where or

// Generate approximate statements:where status = 1 AND (id > 10 or id < 2)
Model::create()->where('status', 1)->where(' (id > 10 or id <2) ')->get();