diff --git a/Application/Admin/Controller/PromoteCompanyController.class.php b/Application/Admin/Controller/PromoteCompanyController.class.php index 6655838a4..f7328afe8 100644 --- a/Application/Admin/Controller/PromoteCompanyController.class.php +++ b/Application/Admin/Controller/PromoteCompanyController.class.php @@ -146,8 +146,10 @@ class PromoteCompanyController extends ThinkController } } + $v['can_del'] = 0; }else{ //空值 + $v['can_del'] = 1; $v['list']=[ [ "account"=>"--", @@ -313,10 +315,23 @@ class PromoteCompanyController extends ThinkController if(isset($save['resources'])){ $save['resources'] = json_encode($save['resources'],JSON_UNESCAPED_UNICODE); } + //判断内外团是否修改 + $is_change_belong = false; + $company_id = $save['id']; + $y_belong = $model->field("company_belong")->where("id = {$save['id']}")->find()['company_belong']; + if(isset($save['company_belong']) && ($y_belong != $save['company_belong'])){ + $is_change_belong = true; + } $res = $model->save($save); if ($res) { \Think\Log::actionLog('PromoteCompany/edit', 'partner', $res); - + //处理底下所有会长的公会属性 + if($is_change_belong){ + $savedata = array( + "company_belong"=>$save['company_belong'] + ); + M("Promote","tab_")->where("company_id = '{$company_id}'")->save($savedata); + } addOperationLog(['op_type'=>1,'key'=>$_POST['company_name'],'op_name'=>'编辑推广公司','url'=>U('PromoteCompany/lists'),'menu'=>'推广员-推广员管理-推广公司管理-编辑推广公司']); $array=array( diff --git a/Application/Admin/View/PromoteCompany/lists.html b/Application/Admin/View/PromoteCompany/lists.html index 5f547a413..27619bd69 100644 --- a/Application/Admin/View/PromoteCompany/lists.html +++ b/Application/Admin/View/PromoteCompany/lists.html @@ -39,7 +39,7 @@
说明:该功能是用于录入工会所属的推广公司名称
+说明:该功能是用于录入工会所属的推广公司名称 / 如需删除公司请先将公司底下会长移走后方可操作