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() {