|
|
|
@ -312,24 +312,18 @@ class PromoteCompanyController extends ThinkController
|
|
|
|
|
public function marketAgree(){
|
|
|
|
|
if(!isset($_REQUEST['ids'])) $this->error("参数错误");
|
|
|
|
|
$ids = $_REQUEST['ids'];
|
|
|
|
|
$dbres = M("PromoteCompanyVerify", 'tab_')->field("id,verify_status,verify_log,company_info")->where("id in ({$ids})")->select();
|
|
|
|
|
$records = M("PromoteCompanyVerify", 'tab_')->where("id in ({$ids})")->select();
|
|
|
|
|
|
|
|
|
|
$service = new PromoteCompanyService();
|
|
|
|
|
foreach($dbres as $k=>$v){
|
|
|
|
|
if($v['verify_status'] != 0) {
|
|
|
|
|
foreach($records as $record){
|
|
|
|
|
if($record['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");
|
|
|
|
|
$v['verify_log'] = json_encode($v['verify_log']);
|
|
|
|
|
$v['verify_status']=1;
|
|
|
|
|
M("PromoteCompanyVerify", 'tab_')->save($v);
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$v['id'],"op_name"=>"市场部审核",'url'=>U('index')]);
|
|
|
|
|
$record = $service->marketAgree($record);
|
|
|
|
|
|
|
|
|
|
$company = json_decode($v['company_info'], true);
|
|
|
|
|
$company = json_decode($record['company_info'], true);
|
|
|
|
|
if (in_array($company['company_belong'], [1, 2])) {
|
|
|
|
|
$service->adminAgree($v, true);
|
|
|
|
|
$service->adminAgree($record, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$this->ajaxReturn(array(
|
|
|
|
@ -419,10 +413,15 @@ class PromoteCompanyController extends ThinkController
|
|
|
|
|
}
|
|
|
|
|
$save['create_time'] = $time;
|
|
|
|
|
$save['turnover_ratio'] = $this->setTurnoverRatio($save);
|
|
|
|
|
$res = D("PromoteCompanyVerify")->add_db($save);
|
|
|
|
|
if ($res) {
|
|
|
|
|
$result = D("PromoteCompanyVerify")->add_db($save);
|
|
|
|
|
if ($result) {
|
|
|
|
|
addOperationLog(['op_type'=>0,'key'=>$save['company_name'],'op_name'=>'新增推广公司','url'=>U('PromoteCompany/lists')]);
|
|
|
|
|
\Think\Log::actionLog('PromoteCompany/add', 'partner', $res);
|
|
|
|
|
\Think\Log::actionLog('PromoteCompany/add', 'partner', $result);
|
|
|
|
|
|
|
|
|
|
if (!in_array($save['company_belong'], [1, 2])) {
|
|
|
|
|
$promoteCompanyService->marketAgree($result, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$array=array(
|
|
|
|
|
"info"=>"添加成功,请联系管理员尽快审核",
|
|
|
|
|
"status"=>1
|
|
|
|
@ -603,12 +602,12 @@ class PromoteCompanyController extends ThinkController
|
|
|
|
|
$save = I('post.');//前端已经验证
|
|
|
|
|
$this->checkData($save);
|
|
|
|
|
|
|
|
|
|
$promoteCompanyService = new PromoteCompanyService();
|
|
|
|
|
try {
|
|
|
|
|
/* $presidentDepositService = new PresidentDepositService();
|
|
|
|
|
if (in_array($save['company_belong'], [1, 2])) {
|
|
|
|
|
$presidentDepositService->checkBeforeSave($save['deposit'] ?? []);
|
|
|
|
|
} */
|
|
|
|
|
$promoteCompanyService = new PromoteCompanyService();
|
|
|
|
|
$promoteCompanyService->checkPromotes($save['promotes'] ?? []);
|
|
|
|
|
$promoteCompanyService->checkCompanyRelation($save['relation'] ?? []);
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
@ -622,6 +621,11 @@ class PromoteCompanyController extends ThinkController
|
|
|
|
|
$res = D("PromoteCompanyVerify")->edit_db($save);
|
|
|
|
|
if ($res) {
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$_POST['company_name'],'op_name'=>'编辑推广公司','url'=>U('PromoteCompany/lists')]);
|
|
|
|
|
|
|
|
|
|
if (!in_array($save['company_belong'], [1, 2])) {
|
|
|
|
|
$promoteCompanyService->marketAgree($res, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$array=array(
|
|
|
|
|
"info"=>"修改成功,请联系管理员尽快审核",
|
|
|
|
|
"status"=>1
|
|
|
|
|