您现在的位置是:首页 > PHP技术PHP技术
Thinkphp3.1.3中组合where条件
2019-10-14【PHP技术】2317 人已围观
简介 一些复杂的项目中我们经常需要进行where条件的组合.二组where组合语法如下$where[‘name’]...
一些复杂的项目中我们经常需要进行where条件的组合. 二组where组合语法如下
$where[‘name’] = array(‘like’, ‘%thinkphp%’); $where[‘title’] = array(‘like’,’%thinkphp%’); $where[‘_logic’] = ‘or’; $map[‘_complex’] = $where; //申明map与where组合 _complex $map[‘id’] = array(‘gt’,1);
最终生成sql
( (namelike’%thinkphp%’)OR(titlelike’%thinkphp%’) ) and id>1
关注宁波网站建设博客,更多精彩分享,敬请期待!
Tags:
很赞哦! ()
相关文章
随机图文
jQuery中实现prop()函数控制多选框(全选,反选)
jQuery中实现prop()函数控制多选框(全选,反选) 看了jQuery手册,对prop()函数又多了一点认识,记忆力不好,记录下来。...
php对网站优化中的分词处理办法
今天突然想到一个分词问题,应用场景:某网站需要特别的seo优化,需要对文章标题自动提取关键词. 这就是一个中文分词应用.经殷雯小编半天的...
thinkphp imagettftext(): Could not find/open font验证码无法显示报错
thinkphp imagettftext(): Could not find/open font tp5.1验证码无法显示.打开debu...
Thinkphp更新数据时间字段的插入
thinkphp在处理数据写入数据库时同时记录操作时间,可以用$arr['add_time'] = time();或date...




微信收款码
支付宝收款码