ThinkPHP6.0在phpstorm添加查询构造器和模型的代码提示

找到Model.php

vendor\topthink\think-orm\src\Model.php
添加

* @method Query where(mixed $field, string $op= null, mixed $condition= null) static查询条件
* @method Query whereTime(string $field, string $op, mixed $range= null) static查询日期和时间
* @method Query whereBetweenTime(string $field, mixed $startTime, mixed $endTimestatic查询日期或者时间范围
* @method Query whereBetweenTimeField(string $startField, string $endFieldstatic查询当前时间在两个时间字段范围
* @method Query whereYear(string $field, string $year'this year'static查询某年
* @method Query whereMonth(string $field, string $month'this month'static查询某月
* @method Query whereDay(string $field, string $day'today'static查询某日
* @method Query whereRaw(string $wherearray$bind= []) static表达式查询
* @method Query whereExp(string $field, string $conditionarray$bind= []) static字段表达式查询
* @method Query when(mixed $condition, mixed $query, mixed $otherwise= null) static条件查询
* @method Query join(mixed $join, mixed $condition= null, string $type'INNER'staticJOIN查询
* @method Query view(mixed $join, mixed $field= null, mixed $on= null, string $type'INNER'static视图查询
* @method Query with(mixed $withstatic关联预载入
* @method Query count(string $fieldstaticCount统计查询
* @method Query min(string $fieldstaticMin统计查询
* @method Query max(string $fieldstaticMax统计查询
* @method Query sum(string $fieldstaticSUM统计查询
* @method Query avg(string $fieldstaticAvg统计查询
* @method Query field(mixed $field, boolean $except= false) static指定查询字段
* @method Query fieldRaw(string $fieldarray$bind= []) static指定查询字段
* @method Query union(mixed $union, boolean $all= false) staticUNION查询
* @method Query limit(mixed $offset, integer $length= null) static查询LIMIT
* @method Query order(mixed $field, string $order= null) static查询ORDER
* @method Query orderRaw(string $fieldarray$bind= []) static查询ORDER
* @method Query cache(mixed $key= null, integer $expire= null) static设置查询缓存
* @method mixed value(string $fieldstatic获取某个字段的值
* @method arraycolumn(string $field, string $key''static获取某个列的值
* @method Model find(mixed $data= null) static查询单个记录 不存在返回Null
* @method Model findOrEmpty(mixed $data= null) static查询单个记录 不存在返回空模型
* @method \think\model\Collection select(mixed $data= null) static查询多个记录
* @method Model withAttr(array$name, \Closure $closure) 动态定义获取器

找到DbManager.php

vendor\topthink\think-orm\src\DbManager.php

添加
* Class DbManager
* @package think
* @mixin BaseQuery
* @mixin Query
* @method \think\db\Query master() static从主服务器读取数据
* @method \think\db\Query readMaster(bool $all= false) static后续从主服务器读取数据
* @method \think\db\Query table(string $tablestatic指定数据表(含前缀)
* @method \think\db\Query name(string $namestatic指定数据表(不含前缀)
* @method \think\db\Query where(mixed $field, string $op= null, mixed $condition= null) static查询条件
* @method \think\db\Query whereRaw(string $wherearray$bind= []) static表达式查询
* @method \think\db\Query whereExp(string $field, string $conditionarray$bind= []) static字段表达式查询
* @method \think\db\Query when(mixed $condition, mixed $query, mixed $otherwise= null) static条件查询
* @method \think\db\Query join(mixed $join, mixed $condition= null, string $type'INNER'staticJOIN查询
* @method \think\db\Query view(mixed $join, mixed $field= null, mixed $on= null, string $type'INNER'static视图查询
* @method \think\db\Query field(mixed $field, boolean $except= false) static指定查询字段
* @method \think\db\Query fieldRaw(string $fieldarray$bind= []) static指定查询字段
* @method \think\db\Query union(mixed $union, boolean $all= false) staticUNION查询
* @method \think\db\Query limit(mixed $offset, integer $length= null) static查询LIMIT
* @method \think\db\Query order(mixed $field, string $order= null) static查询ORDER
* @method \think\db\Query orderRaw(string $fieldarray$bind= []) static查询ORDER
* @method \think\db\Query cache(mixed $key= null , integer $expire= null) static设置查询缓存
* @method \think\db\Query withAttr(string $name,callable $callback= null) static使用获取器获取数据
* @method mixed value(string $fieldstatic获取某个字段的值
* @method arraycolumn(string $field, string $key''static获取某个列的值
* @method mixed find(mixed $data= null) static查询单个记录
* @method mixed select(mixed $data= null) static查询多个记录
* @method integer insert(array$data, boolean $replace= false, boolean $getLastInsID= false, string $sequence= null) static插入一条记录
* @method integer insertGetId(array$data, boolean $replace= false, string $sequence= null) static插入一条记录并返回自增ID
* @method integer insertAll(array$dataSetstatic插入多条记录
* @method integer update(array$datastatic更新记录
* @method integer delete(mixed $data= null) static删除记录
* @method boolean chunk(integer $count, callable $callback, string $column= null) static分块获取数据
* @method \Generator cursor(mixed $data= null) static使用游标查找记录
* @method mixed query(string $sqlarray$bind= [], boolean $master= false, bool $pdo= false) staticSQL查询
* @method integer execute(string $sqlarray$bind= [], boolean $fetch= false, boolean $getLastInsID= false, string $sequence= null) staticSQL执行
* @method \think\Paginator paginate(integer $listRows= 15, mixed $simple= null, array$config= []) static分页查询
* @method mixed transaction(callable $callbackstatic执行数据库事务
* @method void startTrans() static启动事务
* @method void commit() static用于非自动提交状态下面的查询提交
* @method void rollback() static事务回滚
* @method boolean batchQuery(array$sqlArraystatic批处理执行SQL语句
* @method string getLastInsID(string $sequence= null) static获取最近插入的ID

© 版权声明
THE END
喜欢就支持一下吧
点赞15 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容