|
|
|
@ -148,8 +148,8 @@ class UserController extends AdminController
|
|
|
|
|
public function action()
|
|
|
|
|
{
|
|
|
|
|
//获取列表数据
|
|
|
|
|
$Action = M('Action')->where(array('status' => array('gt', -1)));
|
|
|
|
|
$list = $this->lists($Action);
|
|
|
|
|
$Action = SM('Action')->where(array('status' => array('gt', -1)));
|
|
|
|
|
$list = $this->lists($Action,[],'',true,true);
|
|
|
|
|
int_to_string($list);
|
|
|
|
|
// 记录当前列表页的cookie
|
|
|
|
|
Cookie('__forward__', $_SERVER['REQUEST_URI']);
|
|
|
|
@ -216,10 +216,10 @@ class UserController extends AdminController
|
|
|
|
|
$map['uid'] = array('in', $id);
|
|
|
|
|
$map1['id'] = array('in', $id);
|
|
|
|
|
$status = I('method') == 'forbidUser' ? 0 : 1;
|
|
|
|
|
$res = M('UcenterMember')->where($map1)->setField('status', $status);
|
|
|
|
|
$res1 = M('Member')->where($map)->setField('status', $status);
|
|
|
|
|
$res = SM('UcenterMember')->where($map1)->setField('status', $status);
|
|
|
|
|
$res1 = SM('Member')->where($map)->setField('status', $status);
|
|
|
|
|
if ($res && $res1) {
|
|
|
|
|
$nickname = M('Member')->where($map)->field("nickname")->find()['nickname'];//默认一个,多个时需要遍历
|
|
|
|
|
$nickname = SM('Member')->where($map)->field("nickname")->find()['nickname'];//默认一个,多个时需要遍历
|
|
|
|
|
addOperationLog(array(
|
|
|
|
|
"op_type"=>1,
|
|
|
|
|
"key"=> $nickname,
|
|
|
|
@ -433,9 +433,9 @@ class UserController extends AdminController
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
$Member = D('UcenterMember');
|
|
|
|
|
$mem = D('Member');
|
|
|
|
|
$au = D('AuthGroupAccess');
|
|
|
|
|
$Member = SM('UcenterMember');
|
|
|
|
|
$mem = SM('Member');
|
|
|
|
|
$au = SM('AuthGroupAccess');
|
|
|
|
|
$map['id'] = $id;
|
|
|
|
|
$maps['uid'] = $id;
|
|
|
|
|
$info['username'] = $_POST['username'];
|
|
|
|
@ -471,7 +471,9 @@ class UserController extends AdminController
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($smember !== false || $meb || $ag) {
|
|
|
|
|
M('user_pwd')->where($maps)->setField('password', think_encrypt($info['password']));
|
|
|
|
|
if(!IS_SUBSITE){
|
|
|
|
|
M('user_pwd')->where($maps)->setField('password', think_encrypt($info['password']));
|
|
|
|
|
}
|
|
|
|
|
addOperationLog(array(
|
|
|
|
|
"op_type"=>1,
|
|
|
|
|
"key"=>$_POST['username'],
|
|
|
|
@ -491,17 +493,17 @@ class UserController extends AdminController
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$map['id'] = $_GET['id'];
|
|
|
|
|
$Member = D('UcenterMember')->where($map)->find();
|
|
|
|
|
$Member = SM('UcenterMember')->where($map)->find();
|
|
|
|
|
|
|
|
|
|
$Member['apply_leave_time']?($Member['apply_leave_time'] = date("Y-m-d",$Member['apply_leave_time'])):($Member['apply_leave_time']='');
|
|
|
|
|
$Member['leave_time']?($Member['leave_time'] = date("Y-m-d",$Member['leave_time'])):($Member['leave_time']='');
|
|
|
|
|
|
|
|
|
|
$data = D('Member')->where(array('uid' => $_GET['id']))->find();
|
|
|
|
|
$data = SM('Member')->where(array('uid' => $_GET['id']))->find();
|
|
|
|
|
|
|
|
|
|
$au = D('AuthGroupAccess')->where(array('uid' => $_GET['id']))->find();
|
|
|
|
|
$au = SM('AuthGroupAccess')->where(array('uid' => $_GET['id']))->find();
|
|
|
|
|
$this->assign("authid", $au["group_id"]);
|
|
|
|
|
$this->assign("houtai", $au["houtai"]);
|
|
|
|
|
$list = D('AuthGroup')->where(array('status' => 1))->select();
|
|
|
|
|
$list = SM('AuthGroup')->where(array('status' => 1))->select();
|
|
|
|
|
$username = $_POST['username'];
|
|
|
|
|
$password = $_POST['password'];
|
|
|
|
|
$this->assign('lists', $list);
|
|
|
|
@ -698,13 +700,13 @@ class UserController extends AdminController
|
|
|
|
|
|
|
|
|
|
public function delete($id)
|
|
|
|
|
{
|
|
|
|
|
M()->startTrans();
|
|
|
|
|
$nickname = M('Member')->where("uid = '{$id}'")->field("nickname")->find()['nickname'];
|
|
|
|
|
$res1 = M('member')->delete($id);
|
|
|
|
|
$res2 = M('ucenter_member')->delete($id);
|
|
|
|
|
$res3 = M('auth_group_access')->where(array('uid' => $id))->delete();
|
|
|
|
|
SM()->startTrans();
|
|
|
|
|
$nickname = SM('Member')->where("uid = '{$id}'")->field("nickname")->find()['nickname'];
|
|
|
|
|
$res1 = SM('member')->delete($id);
|
|
|
|
|
$res2 =SM('ucenter_member')->delete($id);
|
|
|
|
|
$res3 = SM('auth_group_access')->where(array('uid' => $id))->delete();
|
|
|
|
|
if ($res1 && $res2 && $res3) {
|
|
|
|
|
M()->commit();
|
|
|
|
|
SM()->commit();
|
|
|
|
|
addOperationLog(array(
|
|
|
|
|
"op_type"=>2,
|
|
|
|
|
"key"=> $nickname,
|
|
|
|
@ -712,7 +714,7 @@ class UserController extends AdminController
|
|
|
|
|
));
|
|
|
|
|
$this->success('删除成功');
|
|
|
|
|
} else {
|
|
|
|
|
M()->rollback();
|
|
|
|
|
SM()->rollback();
|
|
|
|
|
$this->error('删除失败' . M()->getError());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|