如何将SQL语句高效转换至ThinkPHP5框架?

更新于
2026-09-22 23:28:09
1阅读来源:SEO资讯
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计265个文字,预计阅读时间需要2分钟。

如何将SQL语句高效转换至ThinkPHP5框架?

下面是简化后的内容:

ThinkPHP框架教程栏目将简单介绍如何将SQL语句转换为TP5,希望对需要的朋友有所帮助!

教你如何将SQL语句转换为TP5?

具体问题描述:

求大神帮我将这段原生SQL语句转换为TP5的格式,谢谢!

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

教你如何把SQL语句转成TP5?

具体问题描述:

求大神帮我把这段原生SQL语句转成TP5的谢谢!就是Db::('name')->这种链式操作的

'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';

实现方法:

如何将SQL语句高效转换至ThinkPHP5框架?

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()

附上手册,多看看手册www.kancloud.cn/manual/thinkphp5/135180

本文共计265个文字,预计阅读时间需要2分钟。

如何将SQL语句高效转换至ThinkPHP5框架?

下面是简化后的内容:

ThinkPHP框架教程栏目将简单介绍如何将SQL语句转换为TP5,希望对需要的朋友有所帮助!

教你如何将SQL语句转换为TP5?

具体问题描述:

求大神帮我将这段原生SQL语句转换为TP5的格式,谢谢!

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

教你如何把SQL语句转成TP5?

具体问题描述:

求大神帮我把这段原生SQL语句转成TP5的谢谢!就是Db::('name')->这种链式操作的

'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';

实现方法:

如何将SQL语句高效转换至ThinkPHP5框架?

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()

附上手册,多看看手册www.kancloud.cn/manual/thinkphp5/135180