From c89d1540e7fa8093670c3344dd1934d23dbaa7ae Mon Sep 17 00:00:00 2001 From: chenzhi Date: Mon, 19 Jul 2021 18:11:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/OldCountController.class.php | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/Application/Admin/Controller/OldCountController.class.php b/Application/Admin/Controller/OldCountController.class.php index 8bf3a519c..5cd2c9094 100644 --- a/Application/Admin/Controller/OldCountController.class.php +++ b/Application/Admin/Controller/OldCountController.class.php @@ -9,6 +9,70 @@ namespace Admin\Controller; */ 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(); + 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; + } + $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); + } + + //2.增加配置 + M("kv")->add([ + 'key'=>"market_manager_group_ids", + 'value'=>'25,30', + 'type'=>'string', + 'remark'=>'市场经理组id' + ]); + M("kv")->add([ + 'key'=>"market_director_group_ids", + 'value'=>'14,28', + 'type'=>'string', + 'remark'=>'市场总监组id' + ]); + //3.增加部门表数据 + M("department")->add([ + 'id'=>1, + 'name'=>'市场一部', + 'group_ids'=>'11,12,14,21,25', + '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() + ]); + + + } + + + //删除吴宏还是高级时候的数据 public function deleteWuhongAltogether() {