diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index 1d6b3fb72..590aa1db4 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -1541,4 +1541,17 @@ function getGameList($partner_id) { return $data; } +function getAdminData ($uid) { + $adminData = M('auth_group_access') + ->field('data_empower_type,data_president') + ->join('left join sys_auth_group on sys_auth_group_access.group_id=sys_auth_group.id') + ->where(array('uid'=>$uid))->find(); + + $promoteData = M('promote','tab_')->field('id')->where(array('admin_id'=>$uid))->select(); + $promoteData = implode(',',array_column($promoteData,'id')); + $adminData['data_president'] = $adminData['data_president'].','.$promoteData; + + return $adminData; +} + ?> diff --git a/Application/Admin/Controller/AuthManagerController.class.php b/Application/Admin/Controller/AuthManagerController.class.php index 816d6e72a..878273c98 100644 --- a/Application/Admin/Controller/AuthManagerController.class.php +++ b/Application/Admin/Controller/AuthManagerController.class.php @@ -438,4 +438,48 @@ class AuthManagerController extends AdminController{ } } + public function dataempower() { + + $auth_group = M('AuthGroup')->where( array('status'=>array('egt','0'),'module'=>'admin','type'=>AuthGroupModel::TYPE_ADMIN) ) + ->getfield('id,id,title,rules'); +// var_dump($auth_group);die(); + $empower_type = M('AuthGroup')->field('data_empower_type')->where(array('id'=>$_GET['group_id']))->find(); +// var_dump($empower_type);die(); + $this->assign('data_empower_type', $empower_type['data_empower_type']); + $this->assign('auth_group', $auth_group); + $this->display(); + + } + + public function dataEmpowerSave() { + $mid = I('id'); + $gid = I('group_id'); + $data_empower_type = I('data_empower_type'); + + if( empty($gid)||empty($data_empower_type) ){ + $this->error('参数有误'); + } + $AuthGroup = D('AuthGroup'); + if( !$AuthGroup->find($gid)){ + $this->error('用户组不存在'); + } + + if( $mid && !$AuthGroup->checkModelId($mid)){ + $this->error($AuthGroup->error); + } + + if ($AuthGroup->where("id = {$gid}")->save(array('data_empower_type'=>$data_empower_type))) { + $this->success('操作成功',U('AuthManager/index')); + } else { + $this->error('操作失败'); + } + + } + + function getRootPromote() { + $promoteData = M('promote','tab_')->field('id as value,account as title')->where(array('level'=>1,'chain'=>'/'))->select(); + + $this->ajaxReturn(json_encode($promoteData)); + } + } diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index 27234fe1a..66c38481f 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -200,7 +200,7 @@ class PromoteController extends ThinkController if (C('PROMOTE_AUTO_AUDIT') == 1) { $status = 1; } - $data = array('account'=>$account,'password'=>$password,'second_pwd'=>$second_pwd,'real_name'=>$real_name,'email'=>$email,'mobile_phone'=>$mobile_phone,'bank_name'=>$bank_name,'bank_card'=>$bank_card,'admin_id'=>$admin,'status'=>$status,'ba_id'=>$ba_id); + $data = array('account'=>$account,'password'=>$password,'second_pwd'=>$second_pwd,'real_name'=>$real_name,'email'=>$email,'mobile_phone'=>$mobile_phone,'bank_name'=>$bank_name,'bank_card'=>$bank_card,'admin_id'=>session('user_auth')['uid'],'status'=>$status,'ba_id'=>$ba_id); if (preg_match('/^[a-zA-Z0-9]{6,15}$/', $account)==false) { $this->error('账号只能是6-15位字母或数字'); diff --git a/Application/Admin/Controller/device_data_foldline.txt b/Application/Admin/Controller/device_data_foldline.txt index 480ca25d3..acbc2d6b9 100644 --- a/Application/Admin/Controller/device_data_foldline.txt +++ b/Application/Admin/Controller/device_data_foldline.txt @@ -1 +1 @@ -{"average":{"news":0,"active":0},"sum":{"news":0,"active":0},"news":[{"time":"2019-11-11 00:00","count":0,"version":"ios"},{"time":"2019-11-11 01:00","count":0,"version":"ios"},{"time":"2019-11-11 02:00","count":0,"version":"ios"},{"time":"2019-11-11 03:00","count":0,"version":"ios"},{"time":"2019-11-11 04:00","count":0,"version":"ios"},{"time":"2019-11-11 05:00","count":0,"version":"ios"},{"time":"2019-11-11 06:00","count":0,"version":"ios"},{"time":"2019-11-11 07:00","count":0,"version":"ios"},{"time":"2019-11-11 08:00","count":0,"version":"ios"},{"time":"2019-11-11 09:00","count":0,"version":"ios"},{"time":"2019-11-11 10:00","count":0,"version":"ios"},{"time":"2019-11-11 11:00","count":0,"version":"ios"},{"time":"2019-11-11 12:00","count":0,"version":"ios"},{"time":"2019-11-11 13:00","count":0,"version":"ios"},{"time":"2019-11-11 14:00","count":0,"version":"ios"},{"time":"2019-11-11 15:00","count":0,"version":"ios"},{"time":"2019-11-11 16:00","count":0,"version":"ios"},{"time":"2019-11-11 17:00","count":0,"version":"ios"},{"time":"2019-11-11 18:00","count":0,"version":"ios"},{"time":"2019-11-11 19:00","count":0,"version":"ios"},{"time":"2019-11-11 20:00","count":0,"version":"ios"},{"time":"2019-11-11 21:00","count":0,"version":"ios"},{"time":"2019-11-11 22:00","count":0,"version":"ios"},{"time":"2019-11-11 23:00","count":0,"version":"ios"},{"time":"2019-11-11 00:00","count":0,"version":"android"},{"time":"2019-11-11 01:00","count":0,"version":"android"},{"time":"2019-11-11 02:00","count":0,"version":"android"},{"time":"2019-11-11 03:00","count":0,"version":"android"},{"time":"2019-11-11 04:00","count":0,"version":"android"},{"time":"2019-11-11 05:00","count":0,"version":"android"},{"time":"2019-11-11 06:00","count":0,"version":"android"},{"time":"2019-11-11 07:00","count":0,"version":"android"},{"time":"2019-11-11 08:00","count":0,"version":"android"},{"time":"2019-11-11 09:00","count":0,"version":"android"},{"time":"2019-11-11 10:00","count":0,"version":"android"},{"time":"2019-11-11 11:00","count":0,"version":"android"},{"time":"2019-11-11 12:00","count":0,"version":"android"},{"time":"2019-11-11 13:00","count":0,"version":"android"},{"time":"2019-11-11 14:00","count":0,"version":"android"},{"time":"2019-11-11 15:00","count":0,"version":"android"},{"time":"2019-11-11 16:00","count":0,"version":"android"},{"time":"2019-11-11 17:00","count":0,"version":"android"},{"time":"2019-11-11 18:00","count":0,"version":"android"},{"time":"2019-11-11 19:00","count":0,"version":"android"},{"time":"2019-11-11 20:00","count":0,"version":"android"},{"time":"2019-11-11 21:00","count":0,"version":"android"},{"time":"2019-11-11 22:00","count":0,"version":"android"},{"time":"2019-11-11 23:00","count":0,"version":"android"}],"active":[{"time":"2019-11-11 00:00","count":0,"version":"ios"},{"time":"2019-11-11 01:00","count":0,"version":"ios"},{"time":"2019-11-11 02:00","count":0,"version":"ios"},{"time":"2019-11-11 03:00","count":0,"version":"ios"},{"time":"2019-11-11 04:00","count":0,"version":"ios"},{"time":"2019-11-11 05:00","count":0,"version":"ios"},{"time":"2019-11-11 06:00","count":0,"version":"ios"},{"time":"2019-11-11 07:00","count":0,"version":"ios"},{"time":"2019-11-11 08:00","count":0,"version":"ios"},{"time":"2019-11-11 09:00","count":0,"version":"ios"},{"time":"2019-11-11 10:00","count":0,"version":"ios"},{"time":"2019-11-11 11:00","count":0,"version":"ios"},{"time":"2019-11-11 12:00","count":0,"version":"ios"},{"time":"2019-11-11 13:00","count":0,"version":"ios"},{"time":"2019-11-11 14:00","count":0,"version":"ios"},{"time":"2019-11-11 15:00","count":0,"version":"ios"},{"time":"2019-11-11 16:00","count":0,"version":"ios"},{"time":"2019-11-11 17:00","count":0,"version":"ios"},{"time":"2019-11-11 18:00","count":0,"version":"ios"},{"time":"2019-11-11 19:00","count":0,"version":"ios"},{"time":"2019-11-11 20:00","count":0,"version":"ios"},{"time":"2019-11-11 21:00","count":0,"version":"ios"},{"time":"2019-11-11 22:00","count":0,"version":"ios"},{"time":"2019-11-11 23:00","count":0,"version":"ios"},{"time":"2019-11-11 00:00","count":0,"version":"android"},{"time":"2019-11-11 01:00","count":0,"version":"android"},{"time":"2019-11-11 02:00","count":0,"version":"android"},{"time":"2019-11-11 03:00","count":0,"version":"android"},{"time":"2019-11-11 04:00","count":0,"version":"android"},{"time":"2019-11-11 05:00","count":0,"version":"android"},{"time":"2019-11-11 06:00","count":0,"version":"android"},{"time":"2019-11-11 07:00","count":0,"version":"android"},{"time":"2019-11-11 08:00","count":0,"version":"android"},{"time":"2019-11-11 09:00","count":0,"version":"android"},{"time":"2019-11-11 10:00","count":0,"version":"android"},{"time":"2019-11-11 11:00","count":0,"version":"android"},{"time":"2019-11-11 12:00","count":0,"version":"android"},{"time":"2019-11-11 13:00","count":0,"version":"android"},{"time":"2019-11-11 14:00","count":0,"version":"android"},{"time":"2019-11-11 15:00","count":0,"version":"android"},{"time":"2019-11-11 16:00","count":0,"version":"android"},{"time":"2019-11-11 17:00","count":0,"version":"android"},{"time":"2019-11-11 18:00","count":0,"version":"android"},{"time":"2019-11-11 19:00","count":0,"version":"android"},{"time":"2019-11-11 20:00","count":0,"version":"android"},{"time":"2019-11-11 21:00","count":0,"version":"android"},{"time":"2019-11-11 22:00","count":0,"version":"android"},{"time":"2019-11-11 23:00","count":0,"version":"android"}]} \ No newline at end of file +{"average":{"news":0,"active":0},"sum":{"news":0,"active":0},"news":[{"time":"2019-12-11 00:00","count":0,"version":"ios"},{"time":"2019-12-11 01:00","count":0,"version":"ios"},{"time":"2019-12-11 02:00","count":0,"version":"ios"},{"time":"2019-12-11 03:00","count":0,"version":"ios"},{"time":"2019-12-11 04:00","count":0,"version":"ios"},{"time":"2019-12-11 05:00","count":0,"version":"ios"},{"time":"2019-12-11 06:00","count":0,"version":"ios"},{"time":"2019-12-11 07:00","count":0,"version":"ios"},{"time":"2019-12-11 08:00","count":0,"version":"ios"},{"time":"2019-12-11 09:00","count":0,"version":"ios"},{"time":"2019-12-11 10:00","count":0,"version":"ios"},{"time":"2019-12-11 11:00","count":0,"version":"ios"},{"time":"2019-12-11 12:00","count":0,"version":"ios"},{"time":"2019-12-11 13:00","count":0,"version":"ios"},{"time":"2019-12-11 14:00","count":0,"version":"ios"},{"time":"2019-12-11 15:00","count":0,"version":"ios"},{"time":"2019-12-11 16:00","count":0,"version":"ios"},{"time":"2019-12-11 17:00","count":0,"version":"ios"},{"time":"2019-12-11 18:00","count":0,"version":"ios"},{"time":"2019-12-11 19:00","count":0,"version":"ios"},{"time":"2019-12-11 20:00","count":0,"version":"ios"},{"time":"2019-12-11 21:00","count":0,"version":"ios"},{"time":"2019-12-11 22:00","count":0,"version":"ios"},{"time":"2019-12-11 23:00","count":0,"version":"ios"},{"time":"2019-12-11 00:00","count":0,"version":"android"},{"time":"2019-12-11 01:00","count":0,"version":"android"},{"time":"2019-12-11 02:00","count":0,"version":"android"},{"time":"2019-12-11 03:00","count":0,"version":"android"},{"time":"2019-12-11 04:00","count":0,"version":"android"},{"time":"2019-12-11 05:00","count":0,"version":"android"},{"time":"2019-12-11 06:00","count":0,"version":"android"},{"time":"2019-12-11 07:00","count":0,"version":"android"},{"time":"2019-12-11 08:00","count":0,"version":"android"},{"time":"2019-12-11 09:00","count":0,"version":"android"},{"time":"2019-12-11 10:00","count":0,"version":"android"},{"time":"2019-12-11 11:00","count":0,"version":"android"},{"time":"2019-12-11 12:00","count":0,"version":"android"},{"time":"2019-12-11 13:00","count":0,"version":"android"},{"time":"2019-12-11 14:00","count":0,"version":"android"},{"time":"2019-12-11 15:00","count":0,"version":"android"},{"time":"2019-12-11 16:00","count":0,"version":"android"},{"time":"2019-12-11 17:00","count":0,"version":"android"},{"time":"2019-12-11 18:00","count":0,"version":"android"},{"time":"2019-12-11 19:00","count":0,"version":"android"},{"time":"2019-12-11 20:00","count":0,"version":"android"},{"time":"2019-12-11 21:00","count":0,"version":"android"},{"time":"2019-12-11 22:00","count":0,"version":"android"},{"time":"2019-12-11 23:00","count":0,"version":"android"}],"active":[{"time":"2019-12-11 00:00","count":0,"version":"ios"},{"time":"2019-12-11 01:00","count":0,"version":"ios"},{"time":"2019-12-11 02:00","count":0,"version":"ios"},{"time":"2019-12-11 03:00","count":0,"version":"ios"},{"time":"2019-12-11 04:00","count":0,"version":"ios"},{"time":"2019-12-11 05:00","count":0,"version":"ios"},{"time":"2019-12-11 06:00","count":0,"version":"ios"},{"time":"2019-12-11 07:00","count":0,"version":"ios"},{"time":"2019-12-11 08:00","count":0,"version":"ios"},{"time":"2019-12-11 09:00","count":0,"version":"ios"},{"time":"2019-12-11 10:00","count":0,"version":"ios"},{"time":"2019-12-11 11:00","count":0,"version":"ios"},{"time":"2019-12-11 12:00","count":0,"version":"ios"},{"time":"2019-12-11 13:00","count":0,"version":"ios"},{"time":"2019-12-11 14:00","count":0,"version":"ios"},{"time":"2019-12-11 15:00","count":0,"version":"ios"},{"time":"2019-12-11 16:00","count":0,"version":"ios"},{"time":"2019-12-11 17:00","count":0,"version":"ios"},{"time":"2019-12-11 18:00","count":0,"version":"ios"},{"time":"2019-12-11 19:00","count":0,"version":"ios"},{"time":"2019-12-11 20:00","count":0,"version":"ios"},{"time":"2019-12-11 21:00","count":0,"version":"ios"},{"time":"2019-12-11 22:00","count":0,"version":"ios"},{"time":"2019-12-11 23:00","count":0,"version":"ios"},{"time":"2019-12-11 00:00","count":0,"version":"android"},{"time":"2019-12-11 01:00","count":0,"version":"android"},{"time":"2019-12-11 02:00","count":0,"version":"android"},{"time":"2019-12-11 03:00","count":0,"version":"android"},{"time":"2019-12-11 04:00","count":0,"version":"android"},{"time":"2019-12-11 05:00","count":0,"version":"android"},{"time":"2019-12-11 06:00","count":0,"version":"android"},{"time":"2019-12-11 07:00","count":0,"version":"android"},{"time":"2019-12-11 08:00","count":0,"version":"android"},{"time":"2019-12-11 09:00","count":0,"version":"android"},{"time":"2019-12-11 10:00","count":0,"version":"android"},{"time":"2019-12-11 11:00","count":0,"version":"android"},{"time":"2019-12-11 12:00","count":0,"version":"android"},{"time":"2019-12-11 13:00","count":0,"version":"android"},{"time":"2019-12-11 14:00","count":0,"version":"android"},{"time":"2019-12-11 15:00","count":0,"version":"android"},{"time":"2019-12-11 16:00","count":0,"version":"android"},{"time":"2019-12-11 17:00","count":0,"version":"android"},{"time":"2019-12-11 18:00","count":0,"version":"android"},{"time":"2019-12-11 19:00","count":0,"version":"android"},{"time":"2019-12-11 20:00","count":0,"version":"android"},{"time":"2019-12-11 21:00","count":0,"version":"android"},{"time":"2019-12-11 22:00","count":0,"version":"android"},{"time":"2019-12-11 23:00","count":0,"version":"android"}]} \ No newline at end of file diff --git a/Application/Admin/Model/MemberModel.class.php b/Application/Admin/Model/MemberModel.class.php index 49ac7baf0..8aa6a761b 100644 --- a/Application/Admin/Model/MemberModel.class.php +++ b/Application/Admin/Model/MemberModel.class.php @@ -71,11 +71,15 @@ class MemberModel extends Model { ); $this->save($data); + $adminData = getAdminData($user['uid']); + /* 记录登录SESSION和COOKIES */ $auth = array( 'uid' => $user['uid'], 'username' => $user['nickname'], 'last_login_time' => $user['last_login_time'], + 'data_empower_type'=>$adminData['data_empower_type'], + 'data_president'=>$adminData['data_president'] ); session('user_auth', $auth); session('user_auth_sign', data_auth_sign($auth)); diff --git a/Application/Admin/View/AuthManager/category.html b/Application/Admin/View/AuthManager/category.html index 8992ba6c7..7c0f31a39 100644 --- a/Application/Admin/View/AuthManager/category.html +++ b/Application/Admin/View/AuthManager/category.html @@ -14,6 +14,7 @@