From c2303a0676c5baa9310f37ec8d2fa0c8cba32afa Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 18 Mar 2021 15:03:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AE=A2=E5=8D=95=E6=8D=A2?= =?UTF-8?q?=E7=BB=91=E5=88=B0=E6=B1=9F=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/SubSpendController.class.php | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) 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);