|
|
|
@ -211,6 +211,13 @@ class UserController extends AdminController
|
|
|
|
|
$res = M('UcenterMember')->where($map1)->setField('status', $status);
|
|
|
|
|
$res1 = M('Member')->where($map)->setField('status', $status);
|
|
|
|
|
if ($res && $res1) {
|
|
|
|
|
$nickname = M('Member')->where($map)->field("nickname")->find()['nickname'];//默认一个,多个时需要遍历
|
|
|
|
|
addOperationLog(array(
|
|
|
|
|
"op_type"=>1,
|
|
|
|
|
"key"=> $nickname,
|
|
|
|
|
"menu"=>"用户-管理组-管理员列表-锁定/解锁",
|
|
|
|
|
"url"=>U("User/index",array("nickname"=>$nickname))
|
|
|
|
|
));
|
|
|
|
|
$this->success('更新成功!');
|
|
|
|
|
} else {
|
|
|
|
|
$this->error('更新失败!');
|
|
|
|
@ -283,6 +290,13 @@ class UserController extends AdminController
|
|
|
|
|
if (!M('Member')->add($user)) {
|
|
|
|
|
$this->error('用户添加失败!');
|
|
|
|
|
} else {
|
|
|
|
|
//操作日志
|
|
|
|
|
addOperationLog(array(
|
|
|
|
|
"op_type"=>0,
|
|
|
|
|
"key"=>$username,
|
|
|
|
|
"url"=>U("User/index",array("nickname"=>$username))
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
\Think\Log::actionLog('User/add', 'Member', $uid);
|
|
|
|
|
$this->success('用户添加成功!', U('index'));
|
|
|
|
|
}
|
|
|
|
@ -399,6 +413,12 @@ class UserController extends AdminController
|
|
|
|
|
|
|
|
|
|
if ($smember !== false || $meb || $ag) {
|
|
|
|
|
M('user_pwd')->where($maps)->setField('password', think_encrypt($info['password']));
|
|
|
|
|
addOperationLog(array(
|
|
|
|
|
"op_type"=>1,
|
|
|
|
|
"key"=>$_POST['username'],
|
|
|
|
|
"url"=>U("User/index",array("nickname"=>$_POST['username']))
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
$this->success('修改成功!', U('User/index'));
|
|
|
|
|
} else {
|
|
|
|
|
$this->error('修改失败!', U('User/index'));
|
|
|
|
@ -604,11 +624,17 @@ 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();
|
|
|
|
|
if ($res1 && $res2 && $res3) {
|
|
|
|
|
M()->commit();
|
|
|
|
|
addOperationLog(array(
|
|
|
|
|
"op_type"=>2,
|
|
|
|
|
"key"=> $nickname,
|
|
|
|
|
"url"=>U("User/index")
|
|
|
|
|
));
|
|
|
|
|
$this->success('删除成功');
|
|
|
|
|
} else {
|
|
|
|
|
M()->rollback();
|
|
|
|
|