882 篇
建站知识总结与分享
搜索“php”
thinkphp5.1 allowField(true)无效不管用
taotaoit 1 1
3471 0 2020-12-30 ThinkPHP5.1
thinkphp版本5.1.40 LTS 表单提交的数据为 $data['id'] = 8; $data['roleTitle'] = '123'; $data['roleDesc'] = 'abc'; 其中id数据表中不存在,所以需要过滤 但是 $rs = $this->allowField(true...
Thinkphp5.1自定义分页样式
web 0 0
1972 0 2020-12-28 ThinkPHP5.1
第一步、添加分页配置 在config目录下新建一个paginate.php配置文件,代码如下: <?php // +---------------------------------------------------------------------- // |分页设置 // +-----------------------...
thinkphp5 paginate.php配置不管用
web 0 0
2152 0 2020-12-28 ThinkPHP5.1
thinkphp5自定义分页样式, 在配置文件夹config里面,新建paginate.php配置文件(不知道为什么默认不存在), 但总是不成功,配置文件不起作用 如果直接写到model里面,是可以的 $list = Db::name('user')->where('status',1)->pagin...
thinkphp5模板布局能否指定某一个页面不显示该模板布局layout?
web 0 0
2604 0 2020-12-26 ThinkPHP5.1
两种方式 1.在控制器里对应的方法里 $this->view->engine->layout(false);// 前提是你继承了Controller namespace app\index\controller; use think\Controller; class User extends Control...
thinkphp5 Class 'app\admin\controller\Request' not found
taotaoit 0 0
3785 0 2020-12-26 ThinkPHP5.1
加上use think\facade\Request;就可以了 完整代码 <?php namespace app\admin\controller; use think\facade\Request; /** * 首页控制器 */ class Index extends Base { /** * ...
PHP如何合并两个对象?
web 0 1
2523 0 2020-12-18 PHP
方法一:先将对象转换为数据数组,然后使用array_merge()函数进行合并,最后将合并后的数据转换为stdClass对象。 说明:在使用array_merge()合并对象时,argument1中的数组元素将被argument2中的数组元素覆盖。如果argument2中的数组具有空值,则这可能使最终对象中的结果元素无效。 ...
thinkphp group by count如何同时使用?分页用到
taotaoit 0 0
3083 0 2020-12-15 ThinkPHP
分页前,需要获取记录条数 $count = M('abc')->where($where)->count(); 但是, 如果查询还需要使用到 GROUP BY的话 $count = M('video_log')->where($where)->group('ip')->count(); ...
thinkphp 提示Class 'think\Db' not found
web 2 2
6297 0 2020-12-15 ThinkPHP
明明有use think\Db; 还是提示Class 'think\Db' not found $list= Db::table('m_my_reserve_assess') ->alias('mra') ->field('mra.id,mra.insert_ti...
thinkphp Class 'Manage\Controller\Db' not found
taotaoit 1 0
3036 0 2020-12-15 ThinkPHP
thinkphp Class 'Manage\Controller\Db' not found 加上use think\Db;就可以了 代码如下: <?php namespace Manage\Controller; use think\Db; class VideoLogController extends ...
解决宝塔Warning: require(): open_basedir restriction in effect
web 0 0
2423 0 2020-12-14 宝塔
处理完之后,一定要重启php服务 thinkphp部署在宝塔上,提示 Warning: require(): open_basedir restriction in effect 直接修改网站设置,网站目录里的防跨站攻击,取消打勾,重启网站就正常了。
thinkphp5报错 Call to a member function toArray() on array
web 0 0
2958 0 2020-12-10 ThinkPHP5.1
thinkphp5内报错Call to a member function toArray() on array 使用场景         使用模型查询后,想获取不包含对象内容的数组结构的结果。 使用方式  $gardenAuth ...
onebase后台系统设置,如果网站关键字和网站描述是同样文字的话,导致网站描述修改失败
taotaoit 0 0
2192 0 2020-12-09 ThinkPHP5.1
onebase后台【系统管理>系统设置】,如果网站关键字和网站描述是同样文字的话,导致网站描述修改失败。 很奇怪的问题,如果关键字和描述文字相同,关键字修改成功,描述却失败了,如下图 追踪数据修改过程,我们发现是因为foreach调用save方法,导致的问题,如果两个字段$name的值$value相同,则第...
thinkphp遍历数组的同时,修改数组的值,引用foreach(&$v)
taotaoit 0 0
2848 0 2020-12-08 ThinkPHP
如果你想在遍历的时候直接改变数组中的值, 就增加引用, 如果只是单纯遍历数组, 可以不用引用 代码示例: $orderlist_banji=$this->logicOrder->getOrderList(['tradestatus'=>['in','2,3'],'classid'=>$classid]...
thinkphp多表联合查询计算总和sum
web 1 0
4545 0 2020-12-07 ThinkPHP
原标题:TP5 数据查询一对多计算总和SUM TP5查询语句 (1)查询语句 Db::table('student') ->alias('st') ->join(['fraction' => 'ft'], 'st.studentID=ft.studentID', 'left') -&g...
ThinkPHP :: Call to a member function assign() on null
web 1 0
3027 0 2020-12-03 ThinkPHP
其实是构造函数写法的问题 PHP自带的构造函数是 __construct() 但是子类不会自动继承父类的构造函数。而ThinkPHP 自己封装了一个构造函数 _initialize()是可以自动继承父类的构造函数 解决方法 1、如果使用TP框架可以用 _initialize()函数 2、TP用户也可以两个一起...
PHP 获取当天凌晨时间戳
web 0 0
2229 0 2020-11-27 PHP
总结几种PHP 获取当天凌晨时间戳方法: 首先设置时区: header("Content-type:text/html;charset=utf-8"); //设置北京时间为默认时区 date_default_timezone_set('PRC'); 方法一: //当天的起始时间戳 $beginToday = ...
关于本站

“最难不过坚持”

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

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

8308921 2698 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 (260)
Mysql (59)
DedeCms (33)
jQuery (74)
证件照 (1)
setInc (4)
setDec (4)
onclick (5)