![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
thinkphp
zzxiaocong
这个作者很懒,什么都没留下…
展开
-
tp6踩坑where查询为空或者不为空的字段Argument 4 passed to think\\db\\Builder::parseExp() must be an instance of thi
if(input('url')=='1'){ $where[]=['url','<>',''];}if(input('VR_JOB_URL')=='2'){ $where[]=['url','=',null];}原创 2021-12-22 11:35:40 · 2254 阅读 · 0 评论 -
tp6常用笔记整理
//返回role_id列对各用,隔开$admin_role = Db::name('admin_role')->order('id', 'desc')->where('admin_id', $admin_id)->column('role_id');//插入多条数据,分每次100Db::name('user')->limit(100)->insertAll($data); //数组转jsonjson_encode()//插入数据返回idDb::name('user原创 2021-12-18 11:11:05 · 1224 阅读 · 0 评论 -
tp6重定向
//引入use think\exception\HttpResponseException;//调用$this->redirect(url('index/wechat/start'));//方法public function redirect(...$args) { throw new HttpResponseException(redirect(...$args)); }原创 2021-11-20 17:04:08 · 1151 阅读 · 1 评论 -
记录tp6分页丢失参数的问题
$data = Db::name('classes')->where($where)->order('id', 'desc')->paginate(['list_rows'=>12, 'query'=>request()->param()], false)原创 2021-11-19 15:07:26 · 269 阅读 · 0 评论 -
tp5.1多表联查
$where=[];$page['page']=input('page');Db::table('think_order')->alias('o')->where($where)->join('think_work w','o.id = w.artist_id')->join('think_card c','o.card_id = c.id')->field('o.*,w.work,c.card')->order('o.id','desc')->pag原创 2021-09-11 11:11:32 · 367 阅读 · 0 评论 -
tp6 整理笔记 ajax+token提交
tp6安装composer create-project topthink/think tp复制根目录.example.env文件改名.env多应用模式composer require topthink/think-multi-app安装模板引擎composer require topthink/think-multi-app引用use think\facade\View;//用法View::assign('','');return View::fetch();命令行创建p原创 2021-09-01 11:52:45 · 452 阅读 · 0 评论 -
tp5.1微信公众平台授权登录
微信公众平台服务号设置-公众号设置开发基本配置前端代码<a href="{:url('wechat/start')}">微信登录</a>php代码<?phpnamespace app\index_m\controller;use think\Db;use think\Controller;use think\Config;use think\Session;use think\Request;/*** 微信授权登录类*/class Wec原创 2021-08-13 19:00:53 · 533 阅读 · 0 评论 -
tp5.1导出简单生产execl表格并导出
最近整理了一下以前写的代码以前用的tp5写的 tp5.1改了引用方法 所以用composer 方便一点附上代码 下载类库composer require phpoffice/phpexcel下载方法public function out(){ $leaves=db('leave')->where($where)->select(); $objPHPExcel=new \PHPExcel(); //设置表头信息 $objPHPExce原创 2021-08-11 18:21:55 · 299 阅读 · 0 评论