多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
​ **SQL清空数据表,并重置主键为1** ~~~sql truncate table 表名 ~~~ ![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动") **分页查询不丢失条件** ~~~php Db::name("table")->where("XXXX")->paginate(10,false,['query'=>request()->param()]); ~~~ ![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动") **获取最新插入的id** ~~~php $userId = Db::name('user')->getLastInsID(); ~~~ ![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动") ~~~html Fastadmin后台列表点击刷新 ~~~ ![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动") ~~~php $(".fa-refresh").trigger("click"); ~~~ ![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动") **thinkphp tp5 模板 引擎 字符串 截取 函数 省略 显示** ~~~php {$d['title']|mb_substr=0,10,'utf-8'} ~~~ ![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动") **模版 时间截转换** ~~~php {$time|date='Y-m-d H:i:s',###} ~~~ ![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动") **测试数据打印** ~~~php error_log(time().'显示设置'.print_r(array(),true),3,dirname(__FILE__).'/error_log.php'); ~~~ ![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动") **TP5 url链接(带参数)的写法** ~~~php window.location.href="{:url('Index/index')}>"+"/ID/"+ID; //这样可以生成,但url模式改变则不能用 window.location.href="{:url('Index/index','ID=" + ID+ "')}" //解析不成功。 window.location.href="{:url('Index/detail',['id' => "+iD+"])}";//解析不成功 window.location.href='{:url("Index/detail")}?id='+ iD ;//解析成功 ~~~ ![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动") **php 正则替换图片url内容(这里是将URL路径改写了)** ~~~php $suffix="http://q8adminx.keai8l.com"; $pregRule = "/<[img|IMG].*?src=[\'|\"](.*?(?:[\.jpg|\.jpeg|\.png|\.gif|\.bmp]))[\'|\"].*?[\/]?>/"; $content = preg_replace($pregRule, '<img src="'.$suffix.'${1}" data-filename="filename"', $articleinfo['content']); $articleinfo['content']=$content; ~~~ ![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动") **tp5 自定义命令脚本执行在宝塔** ~~~php cd /www/wwwroot/xw.njagdl.com/xw/ php think task_wxcatch_all_history ~~~ ![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动") **一旦宝塔后台显示Inode占用比较大的时候 删除 /root/.anyproxy/cache 以及tp5的runtime里面的目录** **TP5输出HTML原样输出怎么处理?** ~~~php {$content|raw|htmlspecialchars_decode} ~~~ ![](data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动") 点击链接加入群聊【ThinkPHP56小功能】:[正在跳转](https://jq.qq.com/?_wv=1027&k=Z0c641WP "正在跳转")  ​