当前位置:网站首页>Thinkphp5中一个字段对应多个模糊查询
Thinkphp5中一个字段对应多个模糊查询
2022-07-02 06:23:00 【夜空の雪風】
前言
最近在开发项目的时候遇到过一个查询条件:需要对一个字段进行多个模糊查询。
解决办法
public function getGroupUser($title)
{
//多个where条件查询
$condition = ['建设单位','监理单位','数字化单位'];
$where_supervisor['title'] = array('or');
foreach ($condition as $value) {
array_unshift($where_supervisor['title'], array('like', '%' . $value . '%'));
}
//拼接搜索条件
$query = self::where($where_supervisor);
return $query->order('key desc')->select();
}
边栏推荐
- 由于不正常断电导致的unexpected inconsistency;RUN fsck MANUALLY问题已解决
- ts和js区别
- Automation - when Jenkins pipline executes the nodejs command, it prompts node: command not found
- 如何调试微信内置浏览器应用(企业号、公众号、订阅号)
- Tool grass welfare post
- sqli-labs通關匯總-page2
- Flex Jiugongge layout
- Basic knowledge of software testing
- JS judge whether the object is empty
- Huawei mindspire open source internship machine test questions
猜你喜欢

Redis -- cache breakdown, penetration, avalanche

Win电脑截图黑屏解决办法

A preliminary study on ant group G6

Sentry construction and use

UEditor . Net version arbitrary file upload vulnerability recurrence

apt命令报证书错误 Certificate verification failed: The certificate is NOT trusted

Linux MySQL 5.6.51 Community Generic 安装教程

Wechat applet Foundation

In depth study of JVM bottom layer (3): garbage collector and memory allocation strategy
![[literature reading and thought notes 13] unprocessing images for learned raw denoising](/img/a5/ed26a90b3edd75a37b2e5164f6b7d2.png)
[literature reading and thought notes 13] unprocessing images for learned raw denoising
随机推荐
JS countdown case
JS to determine whether there is a value in the object in the array
[daily question] - Huawei machine test 01
php中生成随机的6位邀请码
Latex error: the font size command \normalsize is not defined problem solved
Stack (linear structure)
部署api_automation_test过程中遇到的问题
(the 100th blog) written at the end of the second year of doctor's degree -20200818
sprintf_ How to use s
Huawei mindspire open source internship machine test questions
php中根据数字月份返回月份的英文缩写
No process runs when querying GPU, but the video memory is occupied
工具种草福利帖
Improve user experience defensive programming
解决微信小程序swiper组件bindchange事件抖动问题
Brief analysis of PHP session principle
MySQL中的正则表达式
Code execution sequence with and without resolve in promise
unittest. Texttestrunner does not generate TXT test reports
ts和js区别