Merge branch 'feature/promote_company_merge' of wmtx/platform into master

修改bug
master
廖金灵 4 years ago committed by Gogs
commit 482285dd56

@ -178,14 +178,14 @@ class PromoteCompanyService
$application['company_id'] = $companyInfo['id'] = M('promote_company', 'tab_')->add($companyInfo);
}else{
//编辑
$oldInfo = M('promote_company', 'tab_')->field(['id', 'company_belong'])->where(['id' => $application['company_id']])->find();
$oldInfo = M('promote_company', 'tab_')->field(['id', 'company_belong', 'develop_type', 'game_ids'])->where(['id' => $application['company_id']])->find();
/** 内团/无 切换为外团 */
if (in_array($companyInfo['company_belong'], [1, 2]) && !in_array($oldInfo['company_belong'], [1, 2])) {
$isNewDeposit = true;
}
M('promote_company', 'tab_')->save($companyInfo);
$this->changePromote($companyInfo);
$this->changePromote($companyInfo, $oldInfo);
}
$this->savePromoteCompanyRelation($bindRelation, $companyInfo);
@ -236,7 +236,8 @@ class PromoteCompanyService
}
}
protected function changePromote($companyInfo){
protected function changePromote($companyInfo, $oldInfo)
{
$isChangeBelong = false;
$isChangeRelation =false;
@ -245,7 +246,7 @@ class PromoteCompanyService
}
$companyId = $companyInfo['id'];
$oldInfo = M('promote_company', 'tab_')->field('company_belong,develop_type,game_ids')->where(['id' => $companyId])->find();
// $oldInfo = M('promote_company', 'tab_')->field('company_belong,develop_type,game_ids')->where(['id' => $companyId])->find();
if(isset($companyInfo['company_belong']) && ($oldInfo['company_belong'] != $companyInfo['company_belong'])){
$isChangeBelong = true;

Loading…
Cancel
Save