diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 9d75c82f0..c9586f37c 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -308,8 +308,12 @@ class PromoteCompanyController extends ThinkController if(!isset($_REQUEST['ids'])) $this->error("参数错误"); $ids = $_REQUEST['ids']; $dbres = M("PromoteCompanyVerify", 'tab_')->field("id,verify_status,verify_log")->where("id in ({$ids})")->select(); - foreach($dbres as $k=>&$v){ - if($v['verify_status'] != 0) continue; + + $service = new PromoteCompanyService(); + foreach($dbres as $k=>$v){ + if($v['verify_status'] != 0) { + continue; + } $v['verify_log'] = json_decode($v['verify_log'],true); $v['verify_log']['market_user']=$this->admininfo["username"]; $v['verify_log']['market_time']=date("Y-m-d H:i:s"); @@ -317,6 +321,11 @@ class PromoteCompanyController extends ThinkController $v['verify_status']=1; M("PromoteCompanyVerify", 'tab_')->save($v); addOperationLog(['op_type'=>1,'key'=>$v['id'],"op_name"=>"市场部审核",'url'=>U('index')]); + + $company = json_decode($v['company_info'], true); + if (in_array($company['company_belong'], [1, 2])) { + $service->adminAgree($v, true); + } } $this->ajaxReturn(array( 'status' => 1, diff --git a/Application/Base/Service/PresidentDepositService.class.php b/Application/Base/Service/PresidentDepositService.class.php index f2cb9d733..4de6b031b 100644 --- a/Application/Base/Service/PresidentDepositService.class.php +++ b/Application/Base/Service/PresidentDepositService.class.php @@ -213,7 +213,7 @@ class PresidentDepositService throw new \Exception('无选中项'); } $checkStatus = true; - $records = M('president_deposit', 'tab_')->where(['promote_id' => ['in', $promoteIds]])->select(); + $records = M('president_deposit', 'tab_')->where(['company_id' => ['in', $companyIds]])->select(); foreach ($records as $record) { if ($record['status'] != 0) { $checkStatus = false; @@ -224,7 +224,7 @@ class PresidentDepositService throw new \Exception('含有非待确认状态记录,不可批量操作'); } - M('president_deposit', 'tab_')->where(['promote_id' => ['in', $promoteIds]])->save([ + M('president_deposit', 'tab_')->where(['company_id' => ['in', $companyIds]])->save([ 'status' => 1, 'pay_confirm_time' => time(), 'update_time' => time(), diff --git a/Application/Base/Service/PromoteCompanyService.class.php b/Application/Base/Service/PromoteCompanyService.class.php index df4ec23bd..4d06fbb15 100644 --- a/Application/Base/Service/PromoteCompanyService.class.php +++ b/Application/Base/Service/PromoteCompanyService.class.php @@ -149,11 +149,11 @@ class PromoteCompanyService } } - public function adminAgree($application) + public function adminAgree($application, $isAuto = false) { $adminInfo = $_SESSION['onethink_admin']['user_auth']; - $application['verify_log'] = json_decode($application['verify_log'],true); - $application['verify_log']['admin_user'] = $adminInfo["username"]; + $application['verify_log'] = json_decode($application['verify_log'], true); + $application['verify_log']['admin_user'] = $isAuto ? 'AUOT' : $adminInfo["username"]; $application['verify_log']['admin_time'] = date("Y-m-d H:i:s"); $application['verify_log'] = json_encode($application['verify_log']); $application['verify_status'] = 2;