diff --git a/Application/Admin/Controller/ApplyController.class.php b/Application/Admin/Controller/ApplyController.class.php index f242ca50b..9f526af55 100644 --- a/Application/Admin/Controller/ApplyController.class.php +++ b/Application/Admin/Controller/ApplyController.class.php @@ -160,7 +160,9 @@ class ApplyController extends ThinkController $fields = "tab_apply.*,tab_game.ratio as game_ratio,tab_game.money as game_money"; $join = "LEFT JOIN tab_game ON tab_apply.game_id = tab_game.id"; $order = "id desc"; - $data = $applyModel -> joinList($fields, $join, $map, $order); + //为数据权限添加 + setPowerPromoteIds($map); + $data = $applyModel->joinList($fields, $join, $map, $order); $this -> meta_title = '游戏分包列表'; $this -> assign('_page', $data['page']); $listdata = $data['data']; diff --git a/Application/Admin/Controller/MendController.class.php b/Application/Admin/Controller/MendController.class.php index b4a22e062..fd8313f2d 100644 --- a/Application/Admin/Controller/MendController.class.php +++ b/Application/Admin/Controller/MendController.class.php @@ -11,9 +11,8 @@ use Base\Service\PromoteService as PromoteService; class MendController extends ThinkController { public function lists($p=1){ - $this->m_title = '推广补链'; - $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Mend/lists','status'=>1])->find()); - + $this->m_title = '推广补链'; + $this->assign('commonset',M('Kuaijieicon')->where(['url'=>'Mend/lists','status'=>1])->find()); switch ($_GET['type']) { case '': case 1: diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index 9e1c385be..d601e469a 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -133,9 +133,13 @@ class PromoteController extends ThinkController } } } + + //为数据权限添加 + setPowerPromoteIds($map, 'id'); + // dump($map);die(); $list_data = D(self::model_name)->where($map)->order('id DESC')->page($p, $row)->select(); - + $oa_data = []; if (I('oa_associated', -1) == -1) { foreach ($list_data as $k => $v) { diff --git a/Application/Admin/Model/MemberModel.class.php b/Application/Admin/Model/MemberModel.class.php deleted file mode 100644 index 49ac7baf0..000000000 --- a/Application/Admin/Model/MemberModel.class.php +++ /dev/null @@ -1,111 +0,0 @@ - -// +---------------------------------------------------------------------- - -namespace Admin\Model; -use Think\Model; - -/** - * 用户模型 - * @author 麦当苗儿 - */ - -class MemberModel extends Model { - - protected $_validate = array( - array('nickname', '1,16', '昵称长度为1-16个字符', self::EXISTS_VALIDATE, 'length'), - array('nickname', '', '昵称被占用', self::EXISTS_VALIDATE, 'unique'), //用户名被占用 - ); - - public function lists($status = 1, $order = 'uid DESC', $field = true){ - $map = array('status' => $status); - return $this->field($field)->where($map)->order($order)->select(); - } - - /** - * 登录指定用户 - * @param integer $uid 用户ID - * @return boolean ture-登录成功,false-登录失败 - */ - public function login($uid){ - /* 检测是否在当前应用注册 */ - $user = $this->field(true)->find($uid); - if(!$user || 1 != $user['status']) { - $this->error = '用户不存在或已被禁用!'; //应用级别禁用 - return false; - } - - //记录行为 - action_log('user_login', 'member', $uid, $uid); - - /* 登录用户 */ - $this->autoLogin($user); - return true; - } - - /** - * 注销当前用户 - * @return void - */ - public function logout(){ - session('user_auth', null); - session('user_auth_sign', null); - } - - /** - * 自动登录用户 - * @param integer $user 用户信息数组 - */ - private function autoLogin($user){ - /* 更新登录信息 */ - $data = array( - 'uid' => $user['uid'], - 'login' => array('exp', '`login`+1'), - 'last_login_time' => NOW_TIME, - 'last_login_ip' => get_client_ip(1), - ); - $this->save($data); - - /* 记录登录SESSION和COOKIES */ - $auth = array( - 'uid' => $user['uid'], - 'username' => $user['nickname'], - 'last_login_time' => $user['last_login_time'], - ); - session('user_auth', $auth); - session('user_auth_sign', data_auth_sign($auth)); - session('user_auth_expire', time()); - } - - public function getNickName($uid){ - return $this->where(array('uid'=>(int)$uid))->getField('nickname'); - } - - /** - * 验证二级密码 - * @return bool - */ - public function check_sc_pwd($pwd){ - $map['id'] = UID; - $pro = M("ucenter_member")->where($map)->find(); - if ($pro['second_pwd'] === $this->think_ucenter_md5($pwd, UC_AUTH_KEY)) { - return ture; - } else { - return false; - } - } - - /** - * 系统非常规MD5加密方法 - * @param string $str 要加密的字符串 - * @return string - */ - function think_ucenter_md5($str, $key = 'ThinkUCenter'){ - return '' === $str ? '' : md5(sha1($str) . $key); - } -}