377 篇
建站知识总结与分享
搜索“ThinkPHP”
thinkphp5 sql语句field中concat拼接查询字段
taotaoit 0 0
689 0 2023-04-14 ThinkPHP5.1
thinkphp5 sql语句中concat拼接查询字段 拼接查询字段一 $batch = $BatchModel ->alias('a') ->leftJoin("school b", "a.schoolId = b.id") ->l...
ThinkPHP 框架报错: syntax error, unexpected '?'
web 0 0
728 0 2023-03-28 Bootstrap5
双?? 语法在php7.0才有的 切换到7.0版本即可。 或者把 return $lang[$this->lan][$key] ?? ''; 改成 return $lang[$this->lan][$key] ? $lang[$this->lan][$key] : '';
thinkphp5 tcpdf导出pdf乱码,关闭调试模式就好了
web 0 0
709 0 2023-02-08 ThinkPHP5.1
thinkphp5 tcpdf导出pdf乱码,如图 关闭tp5调试模式,就可以了 1.透过Composer浏览正式版TCPDF,转换到业务流程子目录运转如下表所示指示(Windows下DOS指示转换): composer require tecnickcom/tcpdf 指示获得成功继续执行后,TCP...
thinkphp sql语句中使用乘法小数位不精确
taotaoit 1 0
771 0 2022-12-23 ThinkPHP
1,mysql数据库中字段: packNum 箱数 int perNetWeight 每箱重量 float 通过sql语句查询出产品所有数据的同时,计算出总重量sumNetWeight 2,thinkphp查询语句 $ApplyModel->where($where)->field("a.id,...
thinkphp5.1跨域问题解决
web 0 0
714 0 2022-11-25 ThinkPHP5.1
thinkphp5.1跨域问题解决 方法一:在公共控制器里面初始化方法 protected function initialize() { parent::initialize(); // TODO: Change the autogenerated stub header('Acces...
thinkphp6 整合PhpSpreadsheet 导出数据到excel,加边框
taotaoit 0 0
1061 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...
tp5.1 Warning: require(E:\phpstudy_pro\WWW\shangpinhui.cc\public/../thinkphp/base.php): failed to open stream: No such file or directory in
web 0 0
795 0 2022-11-23 ThinkPHP5.1
从git仓库下载的thinkphp5.1的项目,运行报错: tp5.1 Warning: require(E:\phpstudy_pro\WWW\shangpinhui.cc\public/../thinkphp/base.php): failed to open stream: No such file or director...
git下载的thinkphp项目没有thinkphp和vendor目录怎么办?
web 0 0
973 0 2022-11-20 Git
git上传项目到gitee, .gitignore会忽略一些文件(如果不想忽略,可以删除对应文件名) 这样从git仓库克隆下拉的项目,会少一些文件,怎么办呢? 执行命令:composer update 就可以了
开发tp5.1提示控制器不存在,关于控制器类名thinkPHP的驼峰法命名
web 0 0
794 0 2022-11-19 ThinkPHP5.1
这几天刚学习thinkphp开发,控制器名字规范 1.一个是首字母大写(Demo) <?php namespace app\index\controller; class HelloWorld { public function index() { return 'hello,wo...
ThinkPHP提交表单判断上传图片是否为空
web 0 0
795 0 2022-11-07 ThinkPHP5.1
ThinkPHP提交表单判断上传图片是否为空 在用TP框架开发程序处理接收到的表单的时候,要判断<input type="file" name="img">是否有上传图片,来决定是否要将对应的图片信息插入到数据库中。  如果用empty($_FILES)判断业务逻辑可能会出现问题。 即使表单没有上传图片信息...
tp5.1 占位符查询SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
taotaoit 0 0
789 0 2022-11-04 ThinkPHP5.1
tp5.1 占位符查询SQLSTATE[HY093]: Invalid parameter number: parameter was not defined sql语句 ->where('(fromid=:fromid&&toid=:toid)||(fromid=:fromid2&&a...
tp5.1提示SQLSTATE[42S22]: Column not found: 1054 Unknown column 'g.isDel' in 'where clause'
taotaoit 0 1
1321 0 2022-10-25 ThinkPHP5.1
tp5.1提示SQLSTATE[42S22]: Column not found: 1054 Unknown column 'g.isDel' in 'where clause' 提示字段不存在,但数据库里面明明有这个字段, 原因很简单,因为下面还有一条sql语句用到了这条where条件,但是没设置别名->alias...
使用thinkphp6搭建后端api接口流程
web 1 0
1614 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
812 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
1157 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
1330 0 2022-10-01 ThinkPHP6
Thinkphp6.0/TP6框架中dd()打印方法 dd():打印并截断。halt()同效果。dump() 位置\vendor\symfony\var-dumper\Resources\functions\dump.php
关于本站

“最难不过坚持”

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

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

6412946 2611 39
最新评论
https://jueru.net/
评 留言
:weixiao:
评 留言
:shuijiao: :weiqu: :zhenbang: :leng:
评 留言
:yiwen: :yiwen: :yiwen: :yiwen:
评 EasySass: could not generate CSS file. See Output panel for details.
这个业务逻辑多少都有点奇怪了,阅读浏览次数增值在新闻详情页的控制器方法里setInc,这怎么还写进模型事件里了。如果非要用onAfterRead也可以,把新闻文章的内容单独分出来一个news_content表,然后把它和news做关联,然后给news_content表的onAfterRead事件做增值处理,这样点进新闻页内查询到文章内容时才会触发它。
评 TP6模型事件-查询后onAfterRead不好用
文章标签更多
ThinkPHP (254)
Mysql (58)
DedeCms (33)
jQuery (67)
证件照 (1)
setInc (4)
setDec (4)
onclick (5)