case 2: # code... $where['e.ostatus'] = 2; break; default: break; } //查询结果 $count = M('phpyun_expect_order a') ->field('count(*) as count') ->join("left join phpyun_resume_expect as b on(a.eid = b.id) left join phpyun_job_class c on (b.job_classid = c.id) left join phpyun_resume d on (b.uid = d.uid) LEFT JOIN phpyun_member e on(e.uid = a.memberid) left join phpyun_channels f on (e.otro=f.num)") ->where($where) ->find(); $list = M('phpyun_expect_order a') ->field('a.eid,a.memberid,a.count,b.integrity,b.name as ename,c.name as jobname,b.lastupdate,d.name,d.telphone,e.otro,e.mstatus,e.ostatus as order_status,f.name as qrname,h.name as username') ->join("left join phpyun_resume_expect as b on(a.eid = b.id) left join phpyun_job_class c on (b.job_classid = c.id) left join phpyun_resume d on (a.memberid = d.uid) LEFT JOIN phpyun_member e on(e.uid = a.memberid) left join phpyun_channels f on (e.otro=f.num) left join data_users h on(a.uid=h.id)") ->where($where) ->group('a.memberid') ->order('b.integrity desc') ->limit($start . ",10") ->select(); } else { $count = M('phpyun_expect_order a')->field("count(*) as count")->where($where)->find(); $list = M('phpyun_expect_order a')->field('a.eid,a.memberid,a.count,b.integrity,b.name as ename,c.name as jobname,b.lastupdate,d.name,d.telphone,e.otro,e.mstatus,e.ostatus as order_status,f.name as qrname,h.name as username')->join("left join phpyun_resume_expect as b on(a.eid = b.id) left join phpyun_job_class c on (b.job_classid = c.id) left join phpyun_resume d on (a.memberid = d.uid) LEFT JOIN phpyun_member e on(e.uid = a.memberid) left join phpyun_channels f on (e.otro=f.num) left join data_users h on(a.uid=h.id)")->order('b.integrity desc')->where($where)->group('a.memberid')->limit($start . ",10")->select();