thinkphp5 链式操作comment用法

时间:2020-10-21 20:37:16   收藏:0   阅读:21
COMMENT方法 用于在生成的SQL语句中添加注释内容,www.tk-acc.com 例如:

Db::table(‘think_score‘)->comment(‘查询考试前十名分数‘)
->field(‘username,score‘)
->limit(10)
->order(‘score desc‘)
->select();
最终生成的SQL语句是:

SELECT username,score FROM think_score ORDER BY score desc LIMIT 10 / 查询考试前十名分数 /

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!