diff --git a/admin/controllers/app/appusual/Umajia.php b/admin/controllers/app/appusual/Umajia.php new file mode 100644 index 00000000..42998909 --- /dev/null +++ b/admin/controllers/app/appusual/Umajia.php @@ -0,0 +1,107 @@ +input->get('uid')); + + $row = $this->u_entity->get(array('id'=>$uid)); + $info = array( + 'uid' => $row['id'], + 'nickname' => $row['nickname'], + 'mobile' => $row['mobile'], + ); + $majia = array(); + $title ='披上马甲'; + if($row['jsondata']){ + $json = json_decode($row['jsondata'], true); + $majia_uid = $json['majia']['uid']; + + if($majia_uid){ + $row = $this->u_entity->get(array('id'=>$majia_uid)); + if($row){ + $majia = array( + 'uid' => $row['id'], + 'nickname' => $row['nickname'], + 'mobile' => $row['mobile'], + ); + $title ='编辑马甲'; + } + } + } + + $info['majia'] = $majia; + + $this->data['info'] = $info; + $this->data['_title'] = $title; + $this->show_view('app/appusual/umajia/get', true); + } + + public function add(){ + // TODO: Implement add() method. + } + + public function edit(){ + $info = $this->input->post('info'); + + $uid = $info['uid']; + + $user = $this->u_entity->get(array('id'=>$uid)); + $json = $user['jsondata'] ? json_decode($user['jsondata'], true) : array(); + + if($info['majia']){ + $json['majia'] = array('uid' => $info['majia']['uid']); + } else { + unset($json['majia']); + } + + $upd = array( + 'jsondata' => json_encode($json, JSON_UNESCAPED_UNICODE) + ); + + $this->u_entity->update($upd, array('id' => $uid)); + + return $this->show_json(SYS_CODE_SUCCESS, '操作成功!'); + } + + public function del(){ + $uid = $this->input->post('uid'); + + $user = $this->u_entity->get(array('id' => $uid)); + $json = $user['jsondata'] ? json_decode($user['jsondata'], true) : array(); + unset($json['majia']); + + $upd = array( + 'jsondata' => json_encode($json, JSON_UNESCAPED_UNICODE) + ); + + $this->u_entity->update($upd, array('id' => $uid)); + + return $this->show_json(SYS_CODE_SUCCESS, '操作成功!'); + } + + public function batch(){ + // TODO: Implement batch() method. + } + + public function export(){ + // TODO: Implement export() method. + } + +} \ No newline at end of file diff --git a/admin/controllers/app/liche/Member.php b/admin/controllers/app/liche/Member.php index 192794b6..77483889 100755 --- a/admin/controllers/app/liche/Member.php +++ b/admin/controllers/app/liche/Member.php @@ -41,7 +41,18 @@ class Member extends HD_Controller{ $count = $this->userM->count($where); $lists = $this->userM->select($where,'id desc',$page,$size); + foreach($lists as &$row_user){ + if(SUPER_ADMIN == $this->role){//超级管理员才允许操作用户的披上超级马甲 + $majia = array(); + if($row_user['jsondata']){ + $json = json_decode($row_user['jsondata'], true); + $majia = $json['majia'] ? $json['majia'] : array(); + } + $row_user['umajia'] = $majia; + } + } + $this->data['app_id'] = 1; $this->data['lists'] = $lists; $this->data['_title'] = '用户列表'; $this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count); diff --git a/admin/controllers/app/licheb/Member.php b/admin/controllers/app/licheb/Member.php index 02c60e9a..4b65d8fc 100755 --- a/admin/controllers/app/licheb/Member.php +++ b/admin/controllers/app/licheb/Member.php @@ -42,7 +42,17 @@ class Member extends HD_Controller{ $biz = $this->biz_model->get(['id'=>$val['biz_id']],'biz_name'); $lists[$key]['biz_name'] = $biz['biz_name']; $lists[$key]['group_name'] = $this->groups[$val['group_id']]; + + if(SUPER_ADMIN == $this->role){//超级管理员才允许操作用户的披上超级马甲 + $majia = array(); + if($val['jsondata']){ + $json = json_decode($val['jsondata'], true); + $majia = $json['majia'] ? $json['majia'] : array(); + } + $lists[$key]['umajia'] = $majia; + } } + $this->data['app_id'] = 2; $this->data['lists'] = $lists; $this->data['_title'] = '用户列表'; $this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count); diff --git a/admin/views/app/appusual/umajia/get.php b/admin/views/app/appusual/umajia/get.php new file mode 100644 index 00000000..1c0b4442 --- /dev/null +++ b/admin/views/app/appusual/umajia/get.php @@ -0,0 +1,229 @@ +
+
+ 用户信息: +
+ {{info.nickname}} {{info.mobile}} +
+
+
+ +
+ {{info.majia.nickname}} {{info.majia.mobile}} + +
+
+
+
+ +
+
+ + + + + \ No newline at end of file diff --git a/admin/views/app/liche/member/lists.php b/admin/views/app/liche/member/lists.php index 011a8a2d..14a28bad 100755 --- a/admin/views/app/liche/member/lists.php +++ b/admin/views/app/liche/member/lists.php @@ -28,6 +28,7 @@ 手机号码 是否分销 创建时间 + 操作 @@ -40,6 +41,15 @@ onchange="set_publish(this,)"/> + + + 编辑马甲 + 脱去马甲 + + 披上马甲 + +