首页 > Web开发 > 详细

THINKPHP and or 模板语句书写

时间:2019-03-06 17:48:50      阅读:128      评论:0      收藏:0      [点我收藏+]

 

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 模板语句书写

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!