混杂模式 $where = []; array_push($where, 'create_user_id=4 or create_user_id=17'); array_push($where, 'province like "山%"'); $where['city'] = array('=', '济南'); ...
原创
2021-08-13 01:01:54
499阅读
Finance::where('id', '=', 4)->update([ "payment_name" => "范科华2" ]);生成sqlUPDATE `5kcrm_oa_finance` SET `payment_name`='范科华2' WHERE `id` = 4闭包查询:$report = Repor...
原创
2021-08-13 01:01:34
305阅读
tp5.1已经支持json字段查询了tp5.0还不支持,只能使用
原创
2022-08-18 12:30:16
148阅读
在config配置文件里,文件最后引入数据库2的配置信息使用:$list=Db::table('friendlink')->where('id>0')->select();echo'<pre/>';print_r($list);/******************跨数据库查询**/echo'<hr/><h1>跨数据库查询</h1>
原创
2018-09-29 17:05:12
3122阅读
点赞
ThinkPHP5从V5.0.17之后,如果排序使用到SQL函数,要用orderRaw()代替order()进行排序。
原创
2023-05-15 11:03:56
327阅读
方式一直接传入数组$where = array(); if (!empty($status)) $where[] = array('status', '=', $status); if (!empty($auid)) $where[] = array('auid', '=', $auid);::相同的字段...
原创
2023-05-08 14:13:00
171阅读
它是对数据库的CURD操作事件进行了钩子,当事件触发时,会进行回调。 就像是注册事件和前置方法或后置方法类似 下面是demo 会看到在使用查询的同时执行了查询事件,打印出了 'this is query event ' ,并且先于print_r($user); 其中:回调函数中有两个参数:$opti
原创
2021-07-09 15:06:45
558阅读
thinkphp使用
原创
2019-05-02 11:00:27
1139阅读
这里使用的是最新版本的thinphp 6.0
转载
2021-08-02 14:03:39
336阅读
这里使用的是最新版本的thinphp 6.0
原创
2021-08-02 14:03:56
427阅读
php报错PHP Warning: require(): open_basedir restriction in effect. File(/home/wwwroot/xxx.com/vendor/autoload.php) is not within the allowed path(s): (/home/wwwroot/xxx.com/public/:/tmp/:/proc/) in /ho
转载
2018-11-20 09:52:00
476阅读
2评论
Windows版安装a)使用composer create-project topthink/think testTG,来安装thi
原创
2022-08-18 12:01:59
253阅读
ThinkPHP5 隐藏index.php问题 thinkphp模板输出cookie,session中…
原创
2021-07-09 15:08:24
283阅读
第一种控制器调用$productModel = new ProductsModel();$userM = new U
原创
2022-08-18 13:59:50
107阅读
1 Druid数据查询1.1:查询组件介绍在介绍具体的查询之前,我们先来了解一下各种查询都会用到的基本组件,如Filter,Aggregator,Post-Aggregator,Query,Interval等,每种组件都包含很多的细节1.1.1 FilterFilter就是过滤器,在查询语句中就是一个JSON对象,用来对维度进行筛选和过滤,表示维度满足Filter的行是我们需要的数据,类似sql中
转载
2024-04-07 06:06:52
135阅读
Builder类成员$exp 里面看到有 exists(字段是否存在
原创
2022-08-18 11:58:19
61阅读
[TOC] 取出表中改字符串前两位等于01的数据 按主键查询 按主键查用放在括号里 不按主键查 JOIN方法 的左右连接 JOIN方法也是连贯操作方法之一,用于根据两个或多个表中的列之间的关系,从这些表中查询数据。 not in 方法 like 查询 where 按条件筛选查询 更详情点下面连接 J
原创
2021-08-07 12:39:43
392阅读
thinkphp5 left join 一、总结 1、作用:left join就是即使不匹配也返回左表中的数据 2、join使用通式:object join ( mixed join [, mixed $condition = null [, string $type = 'INNER']] ) 弄
转载
2018-05-04 15:59:00
673阅读
thinkphp5内置标签 知道内置标签怎么用,查手册的时候好查 却功能的时候在里面找着来用 内置标签一览 记住名字是内置标签,然后找的时候好找,这些都是在视图或者模板页面调用 volist 这是标签的属性都是双引号,就是写在html页面的东西,双引号 比较标签 实例 if标签
转载
2018-04-16 23:27:00
221阅读
首先,要导入request包:use think\Request;thinkphp5 有三种方式获取 request// 第一种方式:Request::instance();public function getRequest2(){ // use think\Request; $request = Request::instance(); return dum...
原创
2022-01-09 17:45:59
809阅读