67 篇
ThinkPHP6
thinkphp6 整合PhpSpreadsheet 导出数据到excel,加边框
taotaoit 0 0
364 0 2022-11-24 ThinkPHP6
thinkphp6 整合PhpSpreadsheet 导出数据到excel,加边框 效果图 完整代码: <?php namespace app\admin\model; use think\facade\Db; use app\common\model\Base; use PhpOffice\PhpSp...
使用thinkphp6搭建后端api接口流程
web 0 0
887 0 2022-10-06 ThinkPHP6
1、下载tp6 首先搭建wamp,或lamp的环境安装composer,通过composer安装tp6,thinkphp官网已经不再支持直接下载。 composer create-project topthink/think tp6 如果安装当前目录 composer create-project topthink/think . ...
tp6路由规则<id>
taotaoit 0 0
361 0 2022-10-06 ThinkPHP6
1,规则表达式 Route::get('new/<id>','News/read'); // 定义GET请求路由规则 Route::post('new/<id>','News/update'); // 定义POST请求路由规则 Route::put('new/:id','News/update'); // ...
tp5,tp6使用$this->request->param()获取参数时,多增加了路由地址参数
web 0 0
540 0 2022-10-05 ThinkPHP6
在使用$this->request->param()和$this->request->get()时,会多出路由地址参数 解决方法 更改/public/.htaccess文件 <IfModule mod_rewrite.c> Options +FollowSymlinks -Multiv...
Thinkphp6.0/TP6框架中dd()打印方法
taotaoit 0 0
651 0 2022-10-01 ThinkPHP6
Thinkphp6.0/TP6框架中dd()打印方法 dd():打印并截断。halt()同效果。dump() 位置\vendor\symfony\var-dumper\Resources\functions\dump.php
tp6路由生成的url去掉应用名的方法
web 1 0
634 0 2022-09-20 ThinkPHP6
tp6路由生成的url去掉应用名的方法 在入口文件中判断,如果访问的url中包含admin,api等字样,则访问对应的应用;如果不包含则访问前端home应用。 具体代码:public\index.php $path = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST...
Driver [Think] not supported错误ThinkPHP6.0问题解决
web 0 0
658 0 2022-09-19 ThinkPHP6
ThinkPHP6.0出现Driver [Think] not supported错误,如下所示,这个问题新手很常见,就是忘记引入视图模块 只需要在项目根目录下执行composer require topthink/think-view即可
TP6模型事件-查询后onAfterRead不好用
taotaoit 0 0
1028 2 2022-06-15 ThinkPHP6
TP6模型事件-查询后onAfterRead不好用 比如,我想实现浏览新闻后,浏览次数加1 实现: public static function onAfterRead($news) { $news->read_number += 1; $news->save(); } 运行后,浏览次数加1了,很好,对不对...
TP6的cookie助手函数第二个参数一定要字符串
web 0 0
700 0 2022-06-15 ThinkPHP6
TP6中cookie助手函数的第二参数一定要是字符串,否则会报错? cookie("history_goods",$history,25920000); 我这里的$history是数组 Argument 2 passed to think\Cookie::set() must be of the type string, array ...
thinkphp6怎么实现MySql中的concat方法
taotaoit 0 0
866 0 2022-06-13 ThinkPHP6
thinkphp6怎么实现MySql中的concat方法? $where[] = [Db::raw('CONCAT(areaid,',')'), 'LIKE', $areaid.',%']; 实际应用: $where = []; $where[] = ['delete_time', 'null','']; ...
tp6 where查询条件$where[] = ['goodsId', 'in', null];出错
taotaoit 0 0
1475 0 2022-06-13 ThinkPHP6
tp6 where查询条件$where[] = ['goodsId', 'in', null];出错 explode() expects parameter 2 to be string, null given 当查询条件为''的时候,不会出错$where[] = ['goodsId', 'in', ''];,所以...
thinkphp6 数据库查询Db::name('user')->select()查询结果是对象而不是数组
web 0 0
1031 0 2022-06-01 ThinkPHP6
thinkphp6 数据库查询Db::name('user')->select()查询结果是对象而不是数组 Db::table('think_user')->where('status', 1)->select(); select 方法查询结果是一个数据集对象,如果需要转换为数组可以使用 Db::tabl...
thinkphp6 数据库查询Db::name('user')->select()查询结果是否为空,用isEmpty
web 0 0
945 0 2022-06-01 ThinkPHP6
thinkphp6 数据库查询Db::name('user')->select()查询,判断结果是否为空? 数据库的查询结果默认返回数据集对象。 如果要判断数据集是否为空,不能直接使用empty判断,而必须使用数据集对象的isEmpty方法判断, 例如: $users = Db::name('user')-...
tp6数据库查询Db::name使用软删除
web 1 0
899 0 2022-05-27 ThinkPHP6
tp6数据库查询Db::name使用软删除 一般情况下,业务数据不建议真实删除数据,系统提供了软删除机制(模型中使用软删除更为方便)。 // 软删除数据 使用delete_time字段标记删除 Db::name('user') ->where('id', 1) ->useSoftDelete('delete_t...
tp6 当字段中包含中横线时,add操作提示not support data:
web 0 0
1130 0 2022-05-26 ThinkPHP6
tp6 当字段中包含中横线时,add操作提示not support data: not support data goodsNo_1_0-2_2 不符合规范,建议改为下划线
tp6 非法请求:index/hello
taotaoit 2 0
1652 0 2022-04-01 ThinkPHP6
新安装的tp6,访问hello方法,提示 非法请求:index/hello 因为配置文件里启用了路由, 如果下项目route目录里,定义了路由访问此文件方法,则url访问将失效。提示非法请求。 关闭路由 'with_route'       => f...
关于本站

“最难不过坚持”

本人承接扒站仿站,php网站维护,病毒查杀,网站编辑,网站改版,html制作

有需要网站维护,改版,病毒查杀,网站编辑,网站备案,html制作等相关的工作可以联系我。
本人有多年相关工作经验,也可提供免费咨询,交个朋友。
有需要探讨问题的朋友,也可以加我微信,共同探讨!
微信:15011482830 QQ:408917339

4005862 2349 35
文章标签更多
ThinkPHP (240)
Mysql (48)
DedeCms (33)
jQuery (58)
证件照 (1)
setInc (4)
setDec (4)
onclick (5)