当前位置:网站首页>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();
}
边栏推荐
- The default Google browser cannot open the link (clicking the hyperlink does not respond)
- sqli-labs通关汇总-page4
- 2021-07-05C#/CAD二次开发创建圆弧(4)
- Sqli labs customs clearance summary-page4
- Solution to the black screen of win computer screenshot
- (the 100th blog) written at the end of the second year of doctor's degree -20200818
- js的防抖和节流
- Underlying mechanism mvcc
- Use of interrupt()
- VSCODE 安装LATEX环境,参数配置,常见问题解决
猜你喜欢

Sentry搭建和使用

Queue (linear structure)

由於不正常斷電導致的unexpected inconsistency;RUN fsck MANUALLY問題已解决

Stack (linear structure)

Sqli-labs customs clearance (less6-less14)

In depth study of JVM bottom layer (II): hotspot virtual machine object

Latex compiles Chinese in vscode and solves the problem of using Chinese path

Pytest (1) case collection rules

AWD learning
![[Zhang San learns C language] - deeply understand data storage](/img/b5/cf0bfae8eacf335d3c350c9cbadb87.png)
[Zhang San learns C language] - deeply understand data storage
随机推荐
ModuleNotFoundError: No module named ‘jieba. analyse‘; ‘ jieba‘ is not a package
Wechat applet Foundation
Sentry construction and use
Cve - 2015 - 1635 (ms15 - 034) réplication de la vulnérabilité d'exécution de code à distance
js中对于返回Promise对象的语句如何try catch
The default Google browser cannot open the link (clicking the hyperlink does not respond)
Stack (linear structure)
CTF three count
SQLI-LABS通关(less15-less17)
Date time API details
Blog directory of zzq -- updated on 20210601
Overload global and member new/delete
php中在二维数组中根据值返回对应的键值
搭建frp进行内网穿透
2021-07-05C#/CAD二次开发创建圆弧(4)
js中map和forEach的用法
如何调试微信内置浏览器应用(企业号、公众号、订阅号)
Tool grass welfare post
Improve user experience defensive programming
Cve-2015-1635 (ms15-034) Remote Code Execution Vulnerability recurrence