当前位置:网站首页>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();
}
边栏推荐
- Fe - weex uses a simple encapsulated data loading plug-in as the global loading method
- Pytest (2) mark function
- 2021-07-05C#/CAD二次开发创建圆弧(4)
- Sentry搭建和使用
- sqli-labs通关汇总-page2
- Présence d'une panne de courant anormale; Problème de gestion de la fsck d'exécution résolu
- How to debug wechat built-in browser applications (enterprise number, official account, subscription number)
- Sqli - Labs Clearance (less6 - less14)
- Implement strstr() II
- 20201025 visual studio2019 qt5.14 use of signal and slot functions
猜你喜欢

A preliminary study on ant group G6
![[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

MySQL中的正则表达式

SQL注入闭合判断

Latex参考文献引用失败 报错 LaTeX Warning: Citation “*****” on page y undefined on input line *

CTF three count

PHP Session原理简析

Latex error: the font size command \normalsize is not defined problem solved

【文献阅读与想法笔记13】 Unprocessing Images for Learned Raw Denoising

How to debug wechat built-in browser applications (enterprise number, official account, subscription number)
随机推荐
Error "list" object is not callable in Web automatic switching window
(the 100th blog) written at the end of the second year of doctor's degree -20200818
Recursion (maze problem, Queen 8 problem)
JS countdown case
Common function writing method and set get writing method for calculating attributes
Apt command reports certificate error certificate verification failed: the certificate is not trusted
There is no way to drag the win10 desktop icon (you can select it, open it, delete it, create it, etc., but you can't drag it)
SQLI-LABS通关(less18-less20)
2020-9-23 use of QT timer qtimer class.
Flex Jiugongge layout
Nodejs - Express middleware modification header: typeerror [err_invalid_char]: invalid character in header content
apt命令报证书错误 Certificate verification failed: The certificate is NOT trusted
php中根据数字月份返回月份的英文缩写
Basic knowledge of software testing
Browser scrolling for more implementations
js数组的常用的原型方法
Log - 7 - record a major error in missing documents (A4 paper)
Record RDS troubleshooting once -- RDS capacity increases dramatically
解决微信小程序swiper组件bindchange事件抖动问题
默认google浏览器打不开链接(点击超链接没有反应)