1
This commit is contained in:
@@ -259,6 +259,37 @@ class User extends Controller
|
||||
$this->user_obj->insertGetId($inser_data);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有编辑
|
||||
*/
|
||||
public function getAllEditor(){
|
||||
$editors = $this->user_obj->where('type',2)->where('state',0)->select();
|
||||
//获取编辑管理的期刊
|
||||
foreach($editors as $k => $v){
|
||||
$cache_journals = $this->journal_obj->where('editor_id',$v['user_id'])->where('state',0)->select();
|
||||
$editors[$k]['journals'] = $cache_journals;
|
||||
}
|
||||
$re['editors'] = $editors;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改编辑密码
|
||||
*/
|
||||
public function changeEditorPassword(){
|
||||
$data = $this->request->post();
|
||||
// 验证规则
|
||||
$rule = new Validate([
|
||||
'user_id'=>'require|number',
|
||||
'password'=>'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return json(['code' => 1,'msg'=>$rule->getError()]);
|
||||
}
|
||||
$this->user_obj->where('user_id',$data['user_id'])->update(['password'=>md5($data['password'])]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user