首页 > 编程语言 >ThinkPHP6.0在phpstorm添加查询构造器和模型的代码提示

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

时间:2022-11-25 21:58:59浏览次数:44  
标签:null string 查询 phpstorm static mixed Query ThinkPHP6.0 method

ThinkPHP6.0升级后 使用查询构造器和模型都没有了提示

原因是tp6源码中没有添加注释

找到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 $endTime) static 查询日期或者时间范围
* @method Query whereBetweenTimeField(string $startField, string $endField) static 查询当前时间在两个时间字段范围
* @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 $where, array $bind = []) static 表达式查询
* @method Query whereExp(string $field, string $condition, array $bind = []) static 字段表达式查询
* @method Query when(mixed $condition, mixed $query, mixed $otherwise = null) static 条件查询
* @method Query join(mixed $join, mixed $condition = null, string $type = 'INNER') static JOIN查询
* @method Query view(mixed $join, mixed $field = null, mixed $on = null, string $type = 'INNER') static 视图查询
* @method Query with(mixed $with) static 关联预载入
* @method Query count(string $field) static Count统计查询
* @method Query min(string $field) static Min统计查询
* @method Query max(string $field) static Max统计查询
* @method Query sum(string $field) static SUM统计查询
* @method Query avg(string $field) static Avg统计查询
* @method Query field(mixed $field, boolean $except = false) static 指定查询字段
* @method Query fieldRaw(string $field, array $bind = []) static 指定查询字段
* @method Query union(mixed $union, boolean $all = false) static UNION查询
* @method Query limit(mixed $offset, integer $length = null) static 查询LIMIT
* @method Query order(mixed $field, string $order = null) static 查询ORDER
* @method Query orderRaw(string $field, array $bind = []) static 查询ORDER
* @method Query cache(mixed $key = null, integer $expire = null) static 设置查询缓存
* @method mixed value(string $field) static 获取某个字段的值
* @method array column(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

* 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 $table) static 指定数据表(含前缀)
* @method \think\db\Query name(string $name) static 指定数据表(不含前缀)
* @method \think\db\Query where(mixed $field, string $op = null, mixed $condition = null) static 查询条件
* @method \think\db\Query whereRaw(string $where, array $bind = []) static 表达式查询
* @method \think\db\Query whereExp(string $field, string $condition, array $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') static JOIN查询
* @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 $field, array $bind = []) static 指定查询字段
* @method \think\db\Query union(mixed $union, boolean $all = false) static UNION查询
* @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 $field, array $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 $field) static 获取某个字段的值
* @method array column(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 $dataSet) static 插入多条记录
* @method integer update(array $data) static 更新记录
* @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 $sql, array $bind = [], boolean $master = false, bool $pdo = false) static SQL查询
* @method integer execute(string $sql, array $bind = [], boolean $fetch = false, boolean $getLastInsID = false, string $sequence = null) static SQL执行
* @method \think\Paginator paginate(integer $listRows = 15, mixed $simple = null, array $config = []) static 分页查询
* @method mixed transaction(callable $callback) static 执行数据库事务
* @method void startTrans() static 启动事务
* @method void commit() static 用于非自动提交状态下面的查询提交
* @method void rollback() static 事务回滚
* @method boolean batchQuery(array $sqlArray) static 批处理执行SQL语句
* @method string getLastInsID(string $sequence = null) static 获取最近插入的ID

标签:null,string,查询,phpstorm,static,mixed,Query,ThinkPHP6.0,method
From: https://www.cnblogs.com/tn666/p/16926480.html

相关文章

  • 表查询的关键字
    SQL语句查询关键字select:指定需要查询的字段信息select*查所有字段selectname:查name字段selectchar_length(name)支持对字段做处理from:指定需要查询的表信息......
  • SQL语句查询关键词
    目录SQL语句查询关键词查询关键字之where筛选查询关键字之分组groupbyGroup_concat方法查询关键字之having过滤查询关键字之去重distinct关键字之orderby排序查询关键......
  • MySQL数据库:7、SQL常用查询语句
    Python基础之MySQL数据库目录Python基础之MySQL数据库一、SQL语句常用查询方法前期数据准备1、基本查询2、编写SQL语句的小技巧3、查询之where筛选3、1.功能介绍3、2.实......
  • SQL语句查询关键字
    1.SQL语句查询关键字1.select:指定需要查找的字段信息,eg:select*,selectname。同时select也支持对字段做处理,eg:selectchar_length(name)。2.from:指定需要查询的......
  • SQL语句查询关键字
    今日内容概要SQL语句查询关键字selectfromwheregroupbyhavingdistinctorderbylimitregexp多表查询的两种方式子查询连表查询今日内容详细SQL......
  • MySQL查询关键字
    SQL语句查询关键字前期数据准备编写SQL语句的小技巧查询关键字之where筛选查询关键字之groupby分组查询关键字之having过滤查询关键字之distinct去重......
  • MySQL单表查询完整语法
    MySQL单表查询完整语法数据按一定结构存入表中,应该能够按照我们的意愿增删改查,而查这一步,我们最基础的语法是:select*from表名查找某张表的所有字段的所有数据select......
  • 查询关键字
    SQL语句查询关键字数据准备createtableemp(idintprimarykeyauto_increment,namevarchar(20)notnull,genderenum('male','female')notnulldefault'ma......
  • SQL语句查询关键字
    目录SQL语句查询关键字selectfrom编写顺序和查询数据前期数据准备编写SQL语句的小技巧查询关键字之筛选where逻辑运算符notandorbetweennotbetween成员运算符in模糊......
  • MySQL 4 查询关键字
    今日内容详细SQL语句查询关键字selecct指定需要查询的字段信息select*查所有字段selectname查name字段selectchar_length(name)支持对字段做处理from指定需......