Layman ThinkPHP 中 where条件 or,and 同时使用
2024-09-03 05:34:04
Eg:('a'=1 and 'b'=2) or ('c'=3 and 'd'=4) and 'e'=5
解决方法
$condition1['a'] = 1;
$condition1['b'] = 2;
$condition2['c'] = 3;
$condition2['d'] = 4;
$condition['_complex'] = array(
$condition1,
$condition2,
'_logic' => 'or'
);
$condition['e'] = 5;
D('模型')->where($condition)->select();
最新文章
- java数据类型
- [Linux] - Docker pure-ftp使用
- nodejs 框架安装生成app
- textarea 限制字数
- css_day6
- 【原创】用Python爬取LeetCode的AC代码到Github
- 我与 windows kernel 的一段时光
- Spark 读写hive 表
- Mybatis Generator实现分页功能
- python制作词云
- 原型理解:prototype
- DEA和模糊综合评价
- ionic3 git 提交报错
- thinkphp验证器
- [uva P1601] The Morning after Halloween
- Directory /home/hdfs/name is in an inconsistent state: storage directory does not exist or is not a
- WordPaster-dedecms5.7整合教程
- 系统事件管理(Events) ---- HTML5+
- CF1076E:Vasya and a Tree(DFS&;差分)
- The maximum number of processes for the user account running is currently , which can cause performance issues. We recommend increasing this to at least 4096.