20201112
This commit is contained in:
@@ -124,17 +124,20 @@ class Special extends Controller {
|
||||
* @param name:interests type:string require:0 desc:兴趣
|
||||
* @param name:website type:string require:0 desc:编辑主页
|
||||
* @param name:orcid type:string require:0 desc:orcid
|
||||
* @param name:specialIcon type:string require:1 desc:客座编辑头像
|
||||
*
|
||||
*/
|
||||
public function addEditor(){
|
||||
$data = $this->request->post();
|
||||
$insert_editor['journal_id'] = $data['journal_id'];
|
||||
$insert_editor['email'] = $data['email'];
|
||||
$insert_editor['first_name'] = $data['first_name'];
|
||||
$insert_editor['last_name'] = $data['last_name'];
|
||||
$insert_editor['address'] = $data['address'];
|
||||
$insert_editor['interests'] = $data['interests'];
|
||||
$insert_editor['website'] = $data['website'];
|
||||
$insert_editor['orcid'] = $data['orcid'];
|
||||
$insert_editor['email'] = trim($data['email']);
|
||||
$insert_editor['first_name'] = trim($data['first_name']);
|
||||
$insert_editor['last_name'] = trim($data['last_name']);
|
||||
$insert_editor['address'] = trim($data['address']);
|
||||
$insert_editor['interests'] = trim($data['interests']);
|
||||
$insert_editor['website'] = trim($data['website']);
|
||||
$insert_editor['orcid'] = trim($data['orcid']);
|
||||
$insert_editor['icon'] = trim($data['specialIcon']);
|
||||
$uid = $this->journal_special_editor_obj->insertGetId($insert_editor);
|
||||
$insert_to['journal_special_editor_id'] = $uid;
|
||||
$insert_to['journal_special_id'] = $data['journal_special_id'];
|
||||
@@ -406,4 +409,28 @@ class Special extends Controller {
|
||||
return $frag;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 头像图片上传
|
||||
* @description 头像图片上传
|
||||
* @author wangjinlei
|
||||
* @url /api/Special/up_icon_file
|
||||
* @method POST
|
||||
*
|
||||
* @param name:name type:string require:1 default:specialIcon desc:文件域名称
|
||||
*
|
||||
* @return upurl:图片地址
|
||||
*/
|
||||
public function up_icon_file() {
|
||||
$file = request()->file('specialIcon');
|
||||
if ($file) {
|
||||
$info = $file->move(ROOT_PATH . 'public' . DS . 'specialIcon');
|
||||
if ($info) {
|
||||
return json(['code' => 0, 'msg' => 'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
|
||||
} else {
|
||||
return json(['code' => 1, 'msg' => $file->getError()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user