码迷,mamicode.com
首页 > Web开发 > 详细

THINKPHP and or 模板语句书写

时间:2019-03-06 18:01:09      阅读:482      评论:0      收藏:0      [点我收藏+]

标签:pre   sel   语句   complex   rom   think   select   bsp   highlight   

 

select * from xx where (a = 22 or b = 333) or (c=11 and d=22)

$where_1[‘a‘] = array(‘eq‘, ‘222‘);
$where_2[‘b‘] = array(‘eq‘,‘333‘);

$where_3[‘c‘] = 11;
$where_4[‘d‘] = 22;

$map[‘_complex‘][] = [
      $where_1,$where_2,
      ‘_logic‘=>‘or‘,
  ];
$map[‘_complex‘][] = [
      $where_3,$where_4,
      ‘_logic‘=>‘or‘,
];

$this->where($map)->select();


  

THINKPHP and or 模板语句书写

标签:pre   sel   语句   complex   rom   think   select   bsp   highlight   

原文地址:https://www.cnblogs.com/renshi/p/10484723.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!