关于thinkphp关联表的问题
这里面的'as_fields'=>'money,user,user_level,state,detail'是属于哪个表的...
这里面的'as_fields'=>'money,user,user_level,state,detail'是属于哪个表的
展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
2个回答
2015-07-02
展开全部
$db_prefix = C('DB_PREFIX');
$Model = new Model();
$data = $Model->table("{$db_prefix}ordernum as ou")->join("{$db_prefix}orderinfo as oi on ou.ofid=oi.id")->join("{$db_prefix}weekprice as wk on oi.wkid=wk.id")->join("{$db_prefix}stadiums as stm on wk.stm_id=stm.id")->join("{$db_prefix}sports as sp on wk.sp_id=sp.id")->field('ou.uid,oi.id,oi.ordernum,oi.total_money,oi.order_date,oi.ostat,oi.other,stm.stm_name,stm.stm_addr,stm.stm_unique,stm.id as stmid,sp.sp_name,sp.remarks')->where("ou.uid={$_SESSION['uid']}")->group("oi.ordernum")->order("oi.order_date desc")->limit($Page->firstRow . ',' . $Page->listRows)->select();
$Model = new Model();
$data = $Model->table("{$db_prefix}ordernum as ou")->join("{$db_prefix}orderinfo as oi on ou.ofid=oi.id")->join("{$db_prefix}weekprice as wk on oi.wkid=wk.id")->join("{$db_prefix}stadiums as stm on wk.stm_id=stm.id")->join("{$db_prefix}sports as sp on wk.sp_id=sp.id")->field('ou.uid,oi.id,oi.ordernum,oi.total_money,oi.order_date,oi.ostat,oi.other,stm.stm_name,stm.stm_addr,stm.stm_unique,stm.id as stmid,sp.sp_name,sp.remarks')->where("ou.uid={$_SESSION['uid']}")->group("oi.ordernum")->order("oi.order_date desc")->limit($Page->firstRow . ',' . $Page->listRows)->select();
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询