方法一:
$list = $db ->field("sender.*,users.names" )->join( "tab_users on tab_sender.uid=tab_users.id" ) ->limit($p->firstRow.",".$p->listRows)->order('id desc')->select()
方法二:
$modle=new Model();
$sql="select * from tab_cart as a,tab_shop as b where a.shop_id=b.shop_id and a.user_id={$_SESSION['uid']}";
$count=count($model->query($sql));
import('Org.Util.Page');
$page=new Page($count,10);
$show=$page->show();
$res=$model->query("select * from tab_cart as a,tab_shop as b where a.shop_id=b.shop_id and a.user_id={$_SESSION['uid']} limit $page->firstRow,$page->listRows");
//p($res);
//exit();
$this->res=$res;
$this->show=$show;
$this->display();