WHERE函数用法

/* 传递字符串 */
$query->where("id = 1");
$query->where("id = :id")->addParams([":id"=>1]);
$query->where("id = :id",[":id"=>1]);

/* 传递数组 */
$query->where(["username"=>"abei","age"=>[20,19,26]])->from("user");// select * from user where username="abei" AND age in (20,19,26)

/* 操作符 */
$query->where([">","id",10]);// id > 10
$query->where(["<","id",10]); // id < 10
$query->where(["<>","id",10]); // id <> 10
$query->where(["in","id",[10,12]]);// id in (10,20)
$query->where(["not in","id",[10,12]]);// id not in (10,20)
$query->where(["and","id=1","id=2"]); id=1 AND id=2
$query->where(['or', ['type' => [7, 8, 9]], ['id' => [1, 2, 3]]]); // (type IN (7, 8, 9) OR (id IN (1, 2, 3)))
$query->where(["between", 'id', 1, 10]);// id between 1 AND 10
$query->where(["not",["id"=>5]]);// not (id=5)
$query->where(["not between","id",1,10]);// id not between 1 AND 10
$query->where(["like","username","abei"]); // username like "%abei%"
$query->where([['like', 'username', ['abei', 'liuhuan']]]); // username like "%abei%" AND username like "%liuhuan%"
$query->where(['like', 'username', '%abei', false]); // username like "%abei"
$query->where(["or like", 'username', ['abei', 'liuhuan']]);// username like "%abei%" OR username like "%liuhuan%",只作用于范围为数组的形式
$query->where(["not like",xxxxx]);// 与like用法一致
$query->where(["or not like",xxx])// 与not like用法一致