diff --git a/Application/Admin/Controller/SubSpendController.class.php b/Application/Admin/Controller/SubSpendController.class.php index f36630b48..ba561f0d7 100644 --- a/Application/Admin/Controller/SubSpendController.class.php +++ b/Application/Admin/Controller/SubSpendController.class.php @@ -253,13 +253,21 @@ class SubSpendController extends ThinkController if(!isset($_REQUEST['ids']) || !isset($_REQUEST['company_id']) ) $this->error("参数错误"); $ids = $_REQUEST['ids']; $company_id = $_REQUEST['company_id']; - //获取会长及adminid - $promote = M("promote","tab_")->field("id,account,admin_id")->where("company_id = '{$company_id}' and level = '1' and status = '1'")->find(); - $saveData = [ - "promote_id"=>$promote['id'], - "promote_account"=>$promote['account'], - "market_admin_id"=>$promote['admin_id'], - ]; + if($company_id == 0){ + $saveData = [ + "promote_id"=>0, + "promote_account"=>'官方渠道', + "market_admin_id"=>0, + ]; + }else{ + //获取会长及adminid + $promote = M("promote","tab_")->field("id,account,admin_id")->where("company_id = '{$company_id}' and level = '1' and status = '1'")->find(); + $saveData = [ + "promote_id"=>$promote['id'], + "promote_account"=>$promote['account'], + "market_admin_id"=>$promote['admin_id'], + ]; + } $where = [ "id"=>['in',$ids] ]; @@ -310,8 +318,7 @@ class SubSpendController extends ThinkController } //获取所有公司 $promoteCompany = M('promote_company','tab_')->field('id, company_name as name')->where(['status' => 1])->select(); - - + array_unshift($promoteCompany,['id'=>0,'name'=>C('OFFICIEL_CHANNEL')]); $this->assign('promoteCompany', $promoteCompany); $this->assign('data', $sendData); $this->assign('ids', $ids);