public function my_join_activity(){
header('Content-type:text/html;charset=utf-8');
$Model=M();
$unionid=session('unionid');
if(!$unionid){
$inde=A('Index');
$inde->login();
}
//使用原生sql进行多表查询 注意where条件的and语句
$list=$Model->query("select * from activity,apply where apply.ac_id=activity.ac_id and apply.unionid='{$unionid}' order by ap_id desc");
$this->assign('list',$list);
$this->display();
}
用的是tp框架 sql中怎么分页 比如一页显示5个数据 怎么做呢
用count和limit实现