there is a sql statement that you want to construct with the constructor of tp5, as follows
Select * from tab1 where (axi1 and baked 1) or (a2 and baked 2) or (axi3 and baked 3) .or (aural N and baked N)
Note: when N is equal to, there are as many or connections as there are, and the number of or is a variable. How to find out the results with the chain query of Tp5? Has been bothering me all day, asking for an answer from God!
look up an example on the Internet $res = Db::table ("fd_user")-> where (" sex","eq"," male")
-> where (function ($query) {
$query- > where ("name","like"," Lee%")
-> whereOr ("age","eq",18);
})
-> buildSql ();
this is OK, but he has only one whereOr. My requirement is that whereOr is not fixed. There may be one or two. How to break