385 篇
建站知识总结与分享
搜索“think”
thinkphp5 Db::raw提示A non-numeric value encountered
taotaoit 0 0
6 0 2024-04-16 ThinkPHP5.1
thinkphp5 Db::raw提示A non-numeric value encountered 在ThinkPHP5框架中,如果你遇到了“A non-numeric value encountered”这个错误信息,通常意味着你的代码中尝试进行了一个数值操作,但是提供的值不是一个数字。 我的原因是 Db::ra...
thinkphp5 saveAll insertAll getLastInsID
taotaoit 0 0
61 0 2024-04-11 ThinkPHP5.1
thinkphp5 saveAll insertAll getLastInsID 批量新增数据,能不能获得最后增加数据的id? 1,模型方法: $datas = []; $datas[] = ['articleTitle'=>'标题1']; $datas[] = ['articleTitle'=&...
thinkphp5.1通过后台控制调试模式是否开启
taotaoit 0 0
66 0 2024-04-08 ThinkPHP5.1
thinkphp5.1通过后台控制调试模式是否开启 public function edit($fieldType = 0){ $isDebug = input('post.isDebug'); $pat[0] = 'app_debug'; if($isDebug==1){ $rep[0] = true; }else...
thinkphp5.1验证器,多个字段用同一个自定义验证规则
taotaoit 0 0
70 0 2024-04-08 ThinkPHP5.1
thinkphp5.1验证器,多个字段用同一个自定义验证规则 场景: 验证标题内容等字段,是否包含非法字符,并返回提示信息 完整代码: <?php namespace app\shop\validate; use think\Validate; use think\Db; /** * 商品验证器 ...
phpExcel导入提示iconv(): Detected an illegal character in input string
web 0 0
142 0 2024-03-11 ThinkPHP5.1
phpExcel导入提示iconv(): Detected an illegal character in input string 用phpExcel导出excel文件,再导出,结果出错 但是手动创建的excel导入,不会提示这个错误 为什么会出错呢? 打印$from,$to,$value看看是什么...
thinkphp5,phpExcel导出,getDataValidation网页可能暂时无法连接,或者它已永久性地移动到了新网址。
taotaoit 0 0
141 0 2024-03-06 ThinkPHP5.1
做excel导出,下拉选项 thinkphp5,phpExcel导出,getDataValidation网页可能暂时无法连接,或者它已永久性地移动到了新网址。 这是为什么呢?也看不到具体错误。 1,首先要看到具体错误,使用$objWriter->save('1.xls');die;这种方法查看到...
thinkphp5,一条sql将数据库中的一个值从0变为1,1变为0
taotaoit 0 0
146 0 2024-03-06 ThinkPHP5.1
thinkphp5,一条sql将数据库中的一个值从0变为1,1变为0 $up = [             "isAccount" => Db::raw('1-isAccount'),           &nb...
php函数或方法中引用传递变量
taotaoit 0 0
184 0 2024-02-23 PHP
php函数或方法中引用传递变量 thinkphp模型model中,两个方法重复用到一段代码,就想着把这段代码封装起来, 但是有一个变量需要传递给封装函数处理,并且下面还要用到这个变量, 所以就用到了‘引用传递变量’ public function pageQuery($uId = 0){ $i = 2; ...
Thinkphp5.1 Session失效问题解决方案
taotaoit 0 0
250 0 2024-02-02 ThinkPHP5.1
先收集几个网址 https://blog.csdn.net/come11234/article/details/102519965 ThinkPHP5 session配置过期时间不生效的问题https://codeleading.com/article/82015344080/ tp5设置sessio...
thinkphp 时间戳按天分组sql语句怎么写
taotaoit 0 0
216 0 2024-01-26 ThinkPHP5.1
thinkphp 时间戳按天分组sql语句怎么写 $rs = Db::name('order')->field('FROM_UNIXTIME(create_time,"%Y-%m-%d") day,dataSrc,sum(realTotalMoney+ scoreMoney) totalMoney') ->whe...
thinkphp5 validate根据另一个参数的值判断是否必填require
web 0 0
260 0 2024-01-18 ThinkPHP5.1
thinkphp5 validate根据另一个参数的值判断是否必填require 验证某个字段的值等于某个值的时候必须,例如: // 当account的值等于1的时候 password必须 'password'=>'requireIf:account,1' 还有一种情况是layui开关的形式 ...
thinkphp5内置验证规则
taotaoit 0 0
268 0 2024-01-15 ThinkPHP5.1
thinkphp5内置验证规则 https://www.kancloud.cn/manual/thinkphp5_1/354107
thinkphp5,有权限才能下载文件
taotaoit 0 0
268 0 2024-01-15 ThinkPHP5.1
thinkphp5,有权限才能下载文件 需求:留言之后才能下载文件,否则不能下载 实现:留言后,记录ip地址,下载前先检查ip地址是否存在, 代码: 1,模板代码 {notempty name='$details.serviceFile'} <a class="xiaz...
thinkphp5获取系统根目录
taotaoit 0 0
288 0 2024-01-13 ThinkPHP5.1
1,自定义函数 application\common.php里面写上自定义函数 /** * 获取系统根目录 */ function ZHTRootPath(){ return dirname(dirname(__File__)); } 路径类似: D:\phpstudy_pro\WWW\xiangshi.cc ...
thinkphp,jquery自定义添加属性
taotaoit 0 0
207 0 2024-01-12 ThinkPHP5.1
效果图 实现: 1,html代码 <tbody id="spec1Tbody"> </tbody> <tbody> <tr> <th> <a href=...
thinkphp5模板中取余
taotaoit 0 0
233 0 2024-01-09 ThinkPHP5.1
thinkphp5模板中取余 1,在volist标签中,可以设置mod <volist name="list" id="vo" key="i" mod="5"> <eq name="mod" value="0"><tr></eq> <td>{$vo.name}<...
关于本站

“最难不过坚持”

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

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

6385079 2608 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)