优化导出市场专员

master
chenzhi 4 years ago
parent f3b145f930
commit 724fe9e60f

@ -1146,8 +1146,8 @@ class CompanyStatementSetController extends Controller {
$pl = M("promote_company","tab_")
->alias('pc')
->field("p.account,p.company_relation,IFNULL(s.nickname,'admin') nickname")
->join("left join (select company_id,account,company_relation from tab_promote where level = 1 group by company_id ) p on p.company_id = pc.id")//获取会长
->join("left join sys_member s on s.uid = pc.uid")
->join("left join (select company_id,account,company_relation,admin_id from tab_promote where level = 1 group by company_id ) p on p.company_id = pc.id")//获取会长
->join("left join sys_member s on s.uid = p.admin_id")
->where("pc.id = {$company_id}")
->find();
$company = array_merge($company_info,$pl);

Loading…
Cancel
Save