$o=Db::name('主表');ui
$order=$o->alias('a')->join('副表 b','a.pid=b.id')it
->field('a.id,a.uid,a.pid,a.goodsnum,a.size,a.color,a.ordernumber,select
a.status,a.username,a.phone,a.address,a.leave,a.totprice,a.totnum,b.title')
->where(array('a.status'=>array('IN','4,5')))co
->order('id desc')->select();join