Home  >  Article  >  Backend Development  >  Let’s take a look at the tp framework master

Let’s take a look at the tp framework master

WBOY
WBOYOriginal
2016-07-06 13:54:132165browse

<code> $list=$Model->query("select * from activity,apply where apply.ac_id=activity.ac_id and apply.unionid='{$unionid}' order by ap_id desc");</code>

How to use the $User->where('status=1')->order('create_time')->limit($Page->firstRow.', provided in tp for this sql statement) '.$Page->listRows)->select();

How should I write something similar to this? Thank you, Master

Reply content:

<code> $list=$Model->query("select * from activity,apply where apply.ac_id=activity.ac_id and apply.unionid='{$unionid}' order by ap_id desc");</code>

How to use the $User->where('status=1')->order('create_time')->limit($Page->firstRow.', provided in tp for this sql statement) '.$Page->listRows)->select();

How should I write something similar to this? Thank you, Master

The answer by the brother on the first floor seems to have missed the pagination. You can just add limit($Page->firstRow, $Page->listRows) based on the answer by the brother on the first floor. Give it a try! Hope it helps you

<code>$list=M("activity ac")->join("left join apply ap on ac.ac_id=ap.ac_id")->where("apply.unionid=".$unionid)->order("ap_id desc")->select();</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn