您现在的位置是:首页 > PHP技术PHP技术
Thinkphp3.1.3中组合where条件
2019-10-14【PHP技术】2349 人已围观
简介 一些复杂的项目中我们经常需要进行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:
很赞哦! ()
相关文章
随机图文
Thinkphp5.1.30 分页think\paginator\driver\Bootstrap has no effect解决
Tp5.1.30对以往版本有很大的改进。$list = Db:name('表名')->paginate(10);返...
composer安装thinphp5.1的验证码1
按thinkphp5.1开发手机介绍首先需要使用Composer安装think-captcha扩展包,需要fanqiang哦(当然使用国内...
网站安全代码thinkphp3.1密码强度检测
/** *检查密码复杂度 */ publicfunctioncheckPassword($pwd){ if($pwd==null){...
Sublime Text添加插入带当前代码段说明
sublime是小编目前使用当中的一款php程序编辑器,功能非常的强大,今天推荐给各位.下面是如何在代码段内快捷插入常用说明.非常实用哦 ...




微信收款码
支付宝收款码