1. 程式人生 > >thinkphp 5, and與or多條件查詢

thinkphp 5, and與or多條件查詢

最終的查詢條件為where feed_uid=5 and (status=1 or status =2 or status =3 )

$where = [
 'feed_uid'     => [ 'eq' , 5] ,
 'status' => [ [ 'eq' , 1] , [ 'eq' , 2 ] ,  [ 'eq' , 3 ] , 'or' ] ,
   ];
 $value = DealSpace::where($where)->count();

在這裡插入圖片描述