tp5.0的
-
//tp5.0的
-
$where=[
-
'name' => [
'like',
'think%'],
-
'id' => [
'>',
0]
-
];
tp5.1的
-
$where=[
-
[
'name',
'like',
'think%'],
-
[
'id',
'>',
0],
-
];
-
//或者
-
$where[]=[
'name',
'like',
'think%'];
-
$where[]=[
'id',
'>',
0];
-
//或者
-
$where[
'name']=[
'name',
'like',
'think%'];
-
$where[
'id']=[
'id',
'>',
0];
-
//如果需要条件合并
-
//写成
-
$where1[
'status']=[
'status',
'=',
1];
-
$where2[
'status']=[
'status',
'=',
2];
-
$where=array_merge($where1,$where2);