Commit 38d5f154 authored by wangtao's avatar wangtao

管理后台 看板

parent d518036a
This diff is collapsed.
...@@ -34,6 +34,11 @@ class User extends AdminBase ...@@ -34,6 +34,11 @@ class User extends AdminBase
$map[] = ['username|mobile|realname', 'like', '%' . $post['kw'] . '%']; $map[] = ['username|mobile|realname', 'like', '%' . $post['kw'] . '%'];
} }
if (isset($post['role']) && !empty($post['role'])) {
$map[] = ['role', '=', $post['role']];
}
$list = $this->user->where($map)->append(['headericourl', 'sexdata', 'roletxt'])->paginate($post['limit']); $list = $this->user->where($map)->append(['headericourl', 'sexdata', 'roletxt'])->paginate($post['limit']);
return $this->returnMsg($list); return $this->returnMsg($list);
} }
...@@ -91,7 +96,7 @@ class User extends AdminBase ...@@ -91,7 +96,7 @@ class User extends AdminBase
{ {
$post = input(); $post = input();
$user = $this->user->find($post['id']); $user = $this->user->find($post['id']);
$pwd = md5('123456' . $user['salt']); $pwd = md5('ls123456' . $user['salt']);
$result = $this->user->where('id', $post['id'])->update(['password' => $pwd]); $result = $this->user->where('id', $post['id'])->update(['password' => $pwd]);
if ($result) { if ($result) {
return $this->returnMsg("成功", 1); return $this->returnMsg("成功", 1);
......
...@@ -12,7 +12,15 @@ ...@@ -12,7 +12,15 @@
<div class="layui-inline" style="width:250px;"><input type="text" name="kw" placeholder="关键词" autocomplete="off" class="layui-input" lay-affix="clear"/></div> <div class="layui-inline" style="width:250px;"><input type="text" name="kw" placeholder="关键词" autocomplete="off" class="layui-input" lay-affix="clear"/></div>
<div class="layui-inline" style="width:150px;">
<select name="role">
<option value="">审核状态</option>
<option value="1" >普通用户</option>
<option value="2" >企业用户</option>
<option value="3" >高校用户</option>
</select>
</div>
<div class="layui-inline"> <div class="layui-inline">
<div class="layui-btn-group"> <div class="layui-btn-group">
...@@ -139,7 +147,7 @@ ...@@ -139,7 +147,7 @@
usermoneylogOpen(id); usermoneylogOpen(id);
}else if(menudata.id === 'restpwd'){ }else if(menudata.id === 'restpwd'){
layer.confirm('确定要重置【'+data.username+'】的密码为123456?', function(){ layer.confirm('确定要重置【'+data.username+'】的密码为ls123456?', function(){
$.ajax({ $.ajax({
method: "post", method: "post",
url: layui.cache.maps+'/users.user/resetpwd', url: layui.cache.maps+'/users.user/resetpwd',
......
...@@ -25,7 +25,7 @@ class ShCourse extends BaseController ...@@ -25,7 +25,7 @@ class ShCourse extends BaseController
$where = ['sh_course.is_del' => 0, 'user_id' => $request->userId]; $where = ['sh_course.is_del' => 0, 'user_id' => $request->userId];
$map = []; $map = [];
if (isset($parm['searchKeyWords']) && $parm['searchKeyWords']) { if (isset($parm['searchKeyWords']) && $parm['searchKeyWords']) {
$map[] = ['title', 'like', '%' . $parm['searchKeyWords'] . '%']; $map[] = ['sh_course.title', 'like', '%' . $parm['searchKeyWords'] . '%'];
} }
if (isset($parm['status']) && $parm['status'] || $parm['status'] === '0') { if (isset($parm['status']) && $parm['status'] || $parm['status'] === '0') {
$map[] = ['status', '=', $parm['status']]; $map[] = ['status', '=', $parm['status']];
...@@ -38,8 +38,8 @@ class ShCourse extends BaseController ...@@ -38,8 +38,8 @@ class ShCourse extends BaseController
$start_time = strtotime($parm['start_time']); $start_time = strtotime($parm['start_time']);
$end_time = strtotime($parm['end_time']); $end_time = strtotime($parm['end_time']);
$map[] = ['createtime', '>=', $start_time]; $map[] = ['sh_course.createtime', '>=', $start_time];
$map[] = ['createtime', '<=', $end_time]; $map[] = ['sh_course.createtime', '<=', $end_time];
} }
$page = $request->param('page', 1); $page = $request->param('page', 1);
......
...@@ -134,7 +134,8 @@ class Student extends BaseController ...@@ -134,7 +134,8 @@ class Student extends BaseController
return $vo; return $vo;
} }
$parm = $request->param(); $parm = $request->param();
$result = StudentModel::destroy([$parm['student_id']]); $student_id = is_array($parm['student_id']) ? $parm['student_id'] : explode(',', $parm['student_id']);
$result = StudentModel::destroy($student_id);
return $this->returnMsg('success', 1, $result); return $this->returnMsg('success', 1, $result);
} }
......
...@@ -39,6 +39,25 @@ class Aliyun extends Server ...@@ -39,6 +39,25 @@ class Aliyun extends Server
*/ */
public function upload() public function upload()
{ {
$type = $this->config['type'];
$type = isset($this->config[$type]) && is_array($this->config[$type]) ? $type : 'image';
$ext = $this->config[$type]['ext'];
$size = $this->config[$type]['size'];
try{
validate(['file'=>[
'fileSize' => $size * 1024 * 1024,
'fileExt' => $ext
]],[
'file.fileSize' => '上传的文件大小不能超过'.$size.'M',
'file.fileExt' => '请上传后缀为:'.$ext.'的文件'
])->check(['file'=> $this->file]);
}catch(\think\exception\ValidateException $e){
$this->error = $e->getError();
return false;
}
try { try {
$ossClient = new OssClient( $ossClient = new OssClient(
$this->config['access_key_id'], $this->config['access_key_id'],
......
...@@ -44,6 +44,7 @@ abstract class Server ...@@ -44,6 +44,7 @@ abstract class Server
{ {
// 接收上传的文件 // 接收上传的文件
$this->file = request()->file($name); $this->file = request()->file($name);
if (empty($this->file)) { if (empty($this->file)) {
throw new Exception('未找到上传文件的信息'); throw new Exception('未找到上传文件的信息');
} }
...@@ -97,6 +98,7 @@ abstract class Server ...@@ -97,6 +98,7 @@ abstract class Server
{ {
// 要上传图片的本地路径 // 要上传图片的本地路径
$realPath = $this->file->getRealPath(); $realPath = $this->file->getRealPath();
// 扩展名 // 扩展名
$ext = $this->file->getOriginalExtension(); $ext = $this->file->getOriginalExtension();
// 自动生成文件名 // 自动生成文件名
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment