Commit 38d5f154 authored by wangtao's avatar wangtao

管理后台 看板

parent d518036a
This diff is collapsed.
......@@ -34,6 +34,11 @@ class User extends AdminBase
$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']);
return $this->returnMsg($list);
}
......@@ -91,7 +96,7 @@ class User extends AdminBase
{
$post = input();
$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]);
if ($result) {
return $this->returnMsg("成功", 1);
......
......@@ -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: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-btn-group">
......@@ -139,7 +147,7 @@
usermoneylogOpen(id);
}else if(menudata.id === 'restpwd'){
layer.confirm('确定要重置【'+data.username+'】的密码为123456?', function(){
layer.confirm('确定要重置【'+data.username+'】的密码为ls123456?', function(){
$.ajax({
method: "post",
url: layui.cache.maps+'/users.user/resetpwd',
......
......@@ -25,7 +25,7 @@ class ShCourse extends BaseController
$where = ['sh_course.is_del' => 0, 'user_id' => $request->userId];
$map = [];
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') {
$map[] = ['status', '=', $parm['status']];
......@@ -38,8 +38,8 @@ class ShCourse extends BaseController
$start_time = strtotime($parm['start_time']);
$end_time = strtotime($parm['end_time']);
$map[] = ['createtime', '>=', $start_time];
$map[] = ['createtime', '<=', $end_time];
$map[] = ['sh_course.createtime', '>=', $start_time];
$map[] = ['sh_course.createtime', '<=', $end_time];
}
$page = $request->param('page', 1);
......
......@@ -134,7 +134,8 @@ class Student extends BaseController
return $vo;
}
$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);
}
......
......@@ -39,6 +39,25 @@ class Aliyun extends Server
*/
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 {
$ossClient = new OssClient(
$this->config['access_key_id'],
......
......@@ -44,6 +44,7 @@ abstract class Server
{
// 接收上传的文件
$this->file = request()->file($name);
if (empty($this->file)) {
throw new Exception('未找到上传文件的信息');
}
......@@ -97,6 +98,7 @@ abstract class Server
{
// 要上传图片的本地路径
$realPath = $this->file->getRealPath();
// 扩展名
$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