摘要: 数据字段中存放的是id集,形如 1,2,15,35 也可类推json格式 查询时不用拆分了, 用上 instr、concat搜索和连接字符串 查询fids中包含15的 select * from table where instr(concat(',', fids, ','), ',15,') > 阅读全文
posted @ 2019-03-26 09:39 东方素 阅读(224) 评论(0) 推荐(0)
摘要: TP 表前缀不一样 连表查询 类似 wxc_store表和rt_cate 表前缀不一样 链式连表写法 left(['rt_cate' => 'c'], 'a.cid=c.id', left) 阅读全文
posted @ 2025-07-07 09:38 东方素 阅读(4) 评论(0) 推荐(0)
摘要: update tab1 a left join tab2 b on a.store_id=b.store_id set a.order_id=b.id where a.an<> 1 and a.an <> '' insert into tab1 (id,time) select id,time fr 阅读全文
posted @ 2025-05-12 09:24 东方素 阅读(41) 评论(0) 推荐(0)
摘要: 类似 excel的日期为2021-12-28 导入mysql后变成44558 用date_add('1899-12-30', interval 44558 day) 转换成正常日期 阅读全文
posted @ 2025-04-03 11:47 东方素 阅读(3) 评论(0) 推荐(0)
摘要: 出现跨域的解决方式 1.当预处理请求options失败, 代码报错 会出现跨域cors,排查错误代码 2.设置路由跨域 Route::GET('search/list', 'Index/list')->allowCrossDomain(); 阅读全文
posted @ 2023-12-06 17:36 东方素 阅读(88) 评论(0) 推荐(0)
摘要: 在TP项目中,不熟悉composer 手动加载vendor扩展 1.复制依赖包到vendor下 2.修改文件 vendor/composer/autoload_psr4.php,添加命名空间 3.修改文件 vendor/composer/autoload_static.php,添加依赖配置 4.在使 阅读全文
posted @ 2023-10-10 11:15 东方素 阅读(595) 评论(0) 推荐(0)
摘要: 1.每个server块都相当于一个虚拟主机(解析站点),包含多个location(处理请求、配置) server { listen 80;//监听端口 server_name k2.com kh.com;//站点域名 index index.php index.html index.htm defa 阅读全文
posted @ 2023-07-04 09:56 东方素 阅读(25) 评论(0) 推荐(0)
摘要: 1.redis 3种通配符 *(匹配多个字符),?(匹配单个字符),[](匹配括号内某个字符) 2.常用操作 \Facade\Redis::setex('SMS:110:randNumber' ,86400 ,1111);键名,有效期,键值 \Facade\Redis::get($key); \Fa 阅读全文
posted @ 2023-07-03 16:34 东方素 阅读(59) 评论(0) 推荐(0)
摘要: 公司测试服处理 1.git dev分支 2.dev开发完提交=>切换到main,合并dev至当前分支 push 3.ssh git clone url,选择指定分支 git clone -b develop url 4..gitignore 添加忽略后上传gitignore,若文件已追踪,添加忽略上 阅读全文
posted @ 2023-06-26 17:57 东方素 阅读(7) 评论(0) 推荐(0)
摘要: 1.依赖注入,将类以参数的形式传入方法中, 相当于在方法中 new Store(); namespace app\api\controller;use model\ModelEntity as Store;class Api{ //依赖注入 Store,相当于在方式中已 $store = new S 阅读全文
posted @ 2023-04-25 15:12 东方素 阅读(13) 评论(0) 推荐(0)
摘要: 1.链式->count() 查询记录总数 select count(id) from ims_store ->group('name')->count() 分组后的记录总数 select count(*) from (select id from ims_store group by name) a 阅读全文
posted @ 2023-04-15 17:59 东方素 阅读(11) 评论(0) 推荐(0)