Please help me convert this native SQL statement into TP5 thank you!

ask God to help me translate this native SQL statement into TP5 thank you! It is Db:: ("name")-> this kind of chained operation
" select a.id, a.titlerect a. Createwriting time as answer_count from fa_question a. Isometric solvepaper count (b.qid) as answer_count from fa_question a faulty calendar where a.id=b.qid and a.is_solve=0 group by b.qid order by answer_count DESC LIMIT 6 minutes;

Feb.28,2021

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

attach the manual. Read more about the manual https://www.kancloud.cn/manua.

.
Menu