395 篇
建站知识总结与分享
搜索“think”
thinkphp5 unique自动验证账号已存在,数据表默认主键是id
taotaoit 2 0
2963 0 2021-01-04 ThinkPHP5.1
thinkphp5 使用unique自动验证账号是否已存在,好像数据表默认主键必须是id 如果主键不是id,会提示错误SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'field list' 解决办法,可以自定义主键id ...
Thinkphp5清除runtime下的cache缓存,temp缓存,log缓存
web 0 0
2979 0 2020-12-30 ThinkPHP5.1
Thinkphp5清除runtime下的cache缓存,temp缓存,log缓存 /** * 清除缓存 */ public function clearCache(){ \think\facade\Cache::clear(); return ZHTReturn('清除成功',1); } /...
thinkphp5.1 env
taotaoit 0 0
1856 0 2020-12-30 ThinkPHP5.1
$path = env(); dump($path); array(11) { ["THINK_PATH"] => string(26) "D:\www\WWW\maiqi\thinkphp\" ["ROOT_PATH"] => string(17) "D:\www\WWW\maiqi\" ["APP_PATH"...
thinkphp5.1 关闭日志log和日志设置
taotaoit 0 0
4752 0 2020-12-30 ThinkPHP5.1
打开文件config\log.php // +---------------------------------------------------------------------- // | 日志设置 // +----------------------------------------------------------...
thinkphp5.1中使用缓存和清除缓存
taotaoit 0 0
2548 0 2020-12-30 ThinkPHP5.1
使用缓存 public function pageQuery(){ $rs = cache('role'); if(!$rs){ $key = input('key'); $where[] = ['status','=',1]; if($key != '')$where[] = ['roleTitle','...
thinkphp5.1 allowField(true)无效不管用
taotaoit 1 1
3388 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
1898 0 2020-12-28 ThinkPHP5.1
第一步、添加分页配置 在config目录下新建一个paginate.php配置文件,代码如下: <?php // +---------------------------------------------------------------------- // |分页设置 // +-----------------------...
thinkphp5 paginate.php配置不管用
web 0 0
2066 0 2020-12-28 ThinkPHP5.1
thinkphp5自定义分页样式, 在配置文件夹config里面,新建paginate.php配置文件(不知道为什么默认不存在), 但总是不成功,配置文件不起作用 如果直接写到model里面,是可以的 $list = Db::name('user')->where('status',1)->pagin...
thinkphp5模板布局能否指定某一个页面不显示该模板布局layout?
web 0 0
2509 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
3664 0 2020-12-26 ThinkPHP5.1
加上use think\facade\Request;就可以了 完整代码 <?php namespace app\admin\controller; use think\facade\Request; /** * 首页控制器 */ class Index extends Base { /** * ...
thinkphp group by count如何同时使用?分页用到
taotaoit 0 0
2953 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
6210 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
2919 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
2325 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
2850 0 2020-12-10 ThinkPHP5.1
thinkphp5内报错Call to a member function toArray() on array 使用场景         使用模型查询后,想获取不包含对象内容的数组结构的结果。 使用方式  $gardenAuth ...
onebase后台系统设置,如果网站关键字和网站描述是同样文字的话,导致网站描述修改失败
taotaoit 0 0
2105 0 2020-12-09 ThinkPHP5.1
onebase后台【系统管理>系统设置】,如果网站关键字和网站描述是同样文字的话,导致网站描述修改失败。 很奇怪的问题,如果关键字和描述文字相同,关键字修改成功,描述却失败了,如下图 追踪数据修改过程,我们发现是因为foreach调用save方法,导致的问题,如果两个字段$name的值$value相同,则第...
关于本站

“最难不过坚持”

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

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

8022826 2683 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)