|
|
@@ -172,6 +172,19 @@ class Users extends Base
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
|
|
|
+ public function resetPwd(){
|
|
|
+ if(request()->isAjax()){
|
|
|
+ $id = input('param.id/d');
|
|
|
+ $password = md5('123456' . config('salt'));
|
|
|
+ try{
|
|
|
+ db('users')->where('id', $id)->update(['user_pwd' => $password]);
|
|
|
+ }catch(\Exception $e){
|
|
|
+ return json(['code' => -1, 'data' => '', 'msg' => $e->getMessage()]);
|
|
|
+ }
|
|
|
+ return json(['code' => 1, 'data' => 'accounts/index', 'msg' => '重置密码成功']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 删除客服
|
|
|
public function delUser()
|
|
|
{
|
|
|
@@ -211,10 +224,12 @@ class Users extends Base
|
|
|
// 生成按钮
|
|
|
private function makeBtn($id)
|
|
|
{
|
|
|
- $operate = '<a href="' . url('users/edituser', ['id' => $id]) . '">';
|
|
|
- $operate .= '<button type="button" class="btn btn-primary btn-sm"><i class="fa fa-paste"></i> 编辑</button></a> ';
|
|
|
+// $operate = '<a href="' . url('users/edituser', ['id' => $id]) . '">';
|
|
|
+// $operate .= '<button type="button" class="btn btn-primary btn-sm"><i class="fa fa-paste"></i> 编辑</button></a> ';
|
|
|
+
|
|
|
+ $operate = '<a href="javascript:resetPwd(' . $id . ')"><button type="button" class="btn btn-primary btn-sm"><i class="fa fa-paste"></i> 重置密码</button></a>';
|
|
|
|
|
|
- $operate .= '<a href="javascript:userDel(' . $id . ')"><button type="button" class="btn btn-danger btn-sm">';
|
|
|
+ $operate .= '<a style="margin-left:5px;" href="javascript:userDel(' . $id . ')"><button type="button" class="btn btn-danger btn-sm">';
|
|
|
$operate .= '<i class="fa fa-trash-o"></i> 删除</button></a> ';
|
|
|
|
|
|
//$operate .= '<a href="javascript:;">';
|