From 8626cbbc905056666fcffb098d71858cef1b4f27 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 24 Aug 2021 16:37:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/OldCountController.class.php | 63 ++++--------------- 1 file changed, 11 insertions(+), 52 deletions(-) diff --git a/Application/Admin/Controller/OldCountController.class.php b/Application/Admin/Controller/OldCountController.class.php index b3b4470b5..a6758eb1f 100644 --- a/Application/Admin/Controller/OldCountController.class.php +++ b/Application/Admin/Controller/OldCountController.class.php @@ -15,68 +15,27 @@ class OldCountController extends \Think\Controller public function moreDepartment() { //1.新增组 - $manager = M('auth_group','sys_')->where("title = '高级市场专员'")->find(); - $dbres = M('auth_group','sys_')->where("title LIKE '%市场%' AND id != 18")->select(); + $dbres = M('auth_group','sys_')->where("department_id = 2 and department_level != 5")->select(); + // $ids = '32,33,34,35'; + $ids = ''; foreach ($dbres as &$v) { - if($v['id'] == 25){ - $v['rules'] = $manager['rules']; - $v['data_empower_type'] =3; - $v['show_data'] =1; - $v['show_market_admin'] =1; - $v['show_promote'] =1; - } - if(mb_strpos($v['title'],"初级")){ - $v['department_level'] = 1; - } - if(mb_strpos($v['title'],"中级")){ - $v['department_level'] = 2; - } - if(mb_strpos($v['title'],"高级")){ - $v['department_level'] = 3; - } - if(mb_strpos($v['title'],"经理")){ - $v['department_level'] = 4; - } - if(mb_strpos($v['title'],"总监")){ - $v['department_level'] = 5; - } - $v['title'] = "一部".$v['title']; - $v['department_id'] = 1; - $v['department_name'] = "市场一部"; - M('auth_group','sys_')->save($v); - unset($v['id']); - $v['title'] = str_replace("一部","二部",$v['title']); - $v['department_id'] = 2; - $v['department_name'] = '市场二部'; - M('auth_group','sys_')->add($v); + $v['title'] = str_replace("一部","长沙",$v['title']); + $v['department_id'] = 3; + $v['department_name'] = '长沙分部'; + $ids .= ( M('auth_group','sys_')->add($v) . ","); } - + $ids = rtrim($ids,','); //3.增加部门表数据 M("department")->add([ - 'id'=>1, - 'name'=>'市场一部', - 'group_ids'=>'11,12,14,21,25', + 'id'=>3, + 'name'=>'长沙分部', + 'group_ids'=>$ids, 'leader_group'=>'14', 'create_time'=>time(), 'update_time'=>time() ]); - M("department")->add([ - 'id'=>2, - 'name'=>'市场二部', - 'group_ids'=>'26,27,28,29,30', - 'leader_group'=>'28', - 'create_time'=>time(), - 'update_time'=>time() - ]); - - //4.修改旧等级 - M("market_altogether","tab_")->where("level = 21")->save(['level'=>1]); - M("market_altogether","tab_")->where("level = 11")->save(['level'=>2]); - M("market_altogether","tab_")->where("level = 12")->save(['level'=>3]); - M("market_altogether","tab_")->where("level = 25")->save(['level'=>4]); - } public function setDataPresidentInit()