master
tping 4 years ago
parent 0d52dc7d61
commit ff4975bacb

@ -409,6 +409,15 @@ class PartnerController extends ThinkController
$model = M("partner_verify", 'tab_'); $model = M("partner_verify", 'tab_');
if ($_POST) { if ($_POST) {
$save = I("post."); $save = I("post.");
$save['relation']['collaborate_way'] = $save['part_a_type'];
if ($save['part_a_type'] == 1) {
$save['relation']['self_company_id'] = $save['part_b'];
}
if ($save['part_a_type'] == 2) {
$save['relation']['self_company_id'] = $save['part_a'];
}
$this->checkData($save); $this->checkData($save);
try { try {
@ -433,14 +442,6 @@ class PartnerController extends ThinkController
if ($has_check) { if ($has_check) {
$this->error('已存在同名cp,请勿重复添加'); $this->error('已存在同名cp,请勿重复添加');
} }
$save['relation']['collaborate_way'] = $save['part_a_type'];
if ($save['part_a_type'] == 1) {
$save['relation']['self_company_id'] = $save['part_b'];
}
if ($save['part_a_type'] == 2) {
$save['relation']['self_company_id'] = $save['part_a'];
}
$res =D("PartnerVerify")->add_db($save); $res =D("PartnerVerify")->add_db($save);
if ($res) { if ($res) {

@ -460,6 +460,14 @@ class PromoteCompanyController extends ThinkController
$save['promotes'] = json_decode($save['promotes'], true); $save['promotes'] = json_decode($save['promotes'], true);
$save['relation']['collaborate_way'] = $save['part_a_type'];
if ($save['part_a_type'] == 1) {
$save['relation']['self_company_id'] = $save['part_b'];
}
if ($save['part_a_type'] == 2) {
$save['relation']['self_company_id'] = $save['part_a'];
}
$this->checkData($save); $this->checkData($save);
$presidentDepositService = new PresidentDepositService(); $presidentDepositService = new PresidentDepositService();
@ -480,14 +488,6 @@ class PromoteCompanyController extends ThinkController
$save['create_time'] = $time; $save['create_time'] = $time;
$save['turnover_ratio'] = $this->setTurnoverRatio($save); $save['turnover_ratio'] = $this->setTurnoverRatio($save);
$save['relation']['collaborate_way'] = $save['part_a_type'];
if ($save['part_a_type'] == 1) {
$save['relation']['self_company_id'] = $save['part_b'];
}
if ($save['part_a_type'] == 2) {
$save['relation']['self_company_id'] = $save['part_a'];
}
$result = D("PromoteCompanyVerify")->add_db($save); $result = D("PromoteCompanyVerify")->add_db($save);
if ($result) { if ($result) {
addOperationLog(['op_type'=>0,'key'=>$save['company_name'],'op_name'=>'新增推广公司','url'=>U('PromoteCompany/lists')]); addOperationLog(['op_type'=>0,'key'=>$save['company_name'],'op_name'=>'新增推广公司','url'=>U('PromoteCompany/lists')]);
@ -675,6 +675,15 @@ class PromoteCompanyController extends ThinkController
{ {
if ($_POST) { if ($_POST) {
$save = I('post.');//前端已经验证 $save = I('post.');//前端已经验证
$save['relation']['collaborate_way'] = $save['part_a_type'];
if ($save['part_a_type'] == 1) {
$save['relation']['self_company_id'] = $save['part_b'];
}
if ($save['part_a_type'] == 2) {
$save['relation']['self_company_id'] = $save['part_a'];
}
$this->checkData($save); $this->checkData($save);
$promoteCompanyService = new PromoteCompanyService(); $promoteCompanyService = new PromoteCompanyService();
@ -699,14 +708,6 @@ class PromoteCompanyController extends ThinkController
)); ));
} }
$save['relation']['collaborate_way'] = $save['part_a_type'];
if ($save['part_a_type'] == 1) {
$save['relation']['self_company_id'] = $save['part_b'];
}
if ($save['part_a_type'] == 2) {
$save['relation']['self_company_id'] = $save['part_a'];
}
$save['turnover_ratio'] = $this->setTurnoverRatio($save); $save['turnover_ratio'] = $this->setTurnoverRatio($save);
$res = D("PromoteCompanyVerify")->edit_db($save); $res = D("PromoteCompanyVerify")->edit_db($save);
if ($res) { if ($res) {

Loading…
Cancel
Save