下面thinkphp框架教程栏目将给大家简单介绍下如何把sql语句转成tp5,希望对需要的朋友有所帮助!

教你如何把SQL语句转成TP5?
具体问题描述:
求大神帮我把这段原生SQL语句转成TP5的谢谢!就是Db::(‘name’)->这种链式操作的
微软文字转语音
微软文本转语音,支持选择多种语音风格,可调节语速。
0 查看详情
'select a.id, a.title,a.create_time,a.is_solve,count(b.qid) as answer_count from fa_question a,fa_answer b where a.id=b.qid and a.is_solve=0 group by b.qid order by answer_count DESC LIMIT 6';
实现方法:
Db::table(['fa_question '=>'a','think_role'=>'b']) ->field('a.id, a.title, a.create_time, a.is_solve, count(b.qid) as answer_count) ->where(' a.id=b.qid and a.is_solve=0') ->group('b.qid') ->order('answer_count desc') ->limit(6) ->select()
附上手册,多看看手册https://www.kancloud.cn/manual/thinkphp5/135180
以上就是教你如何把SQL语句转成TP5的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/344387.html
微信扫一扫
支付宝扫一扫