20201112
This commit is contained in:
@@ -144,7 +144,7 @@ class Special extends Controller {
|
||||
public function getSpecialDetail(){
|
||||
$data = $this->request->post();
|
||||
$special_info = $this->journal_special_obj->where('journal_special_id',$data['journal_special_id'])->find();
|
||||
$editor_list = $this->journal_special_to_editor_obj->field('j_journal_special_editor.*')
|
||||
$editor_list = $this->journal_special_to_editor_obj->field('j_journal_special_editor.*,j_journal_special_editor.icon specialIcon')
|
||||
->join('j_journal_special_editor','j_journal_special_editor.journal_special_editor_id = j_journal_special_to_editor.journal_special_editor_id','LEFT')
|
||||
->where('j_journal_special_to_editor.journal_special_id',$data['journal_special_id'])
|
||||
->where('j_journal_special_to_editor.state',0)
|
||||
@@ -204,18 +204,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 addSpecialEditor(){
|
||||
$data = $this->request->post();
|
||||
$insert['journal_id'] = $data['journal_id'];
|
||||
$insert['email'] = $data['email'];
|
||||
$insert['first_name'] = $data['first_name'];
|
||||
$insert['last_name'] = $data['last_name'];
|
||||
$insert['address'] = $data['address'];
|
||||
$insert['interests'] = $data['interests'];
|
||||
$insert['website'] = $data['website'];
|
||||
$insert['orcid'] = $data['orcid'];
|
||||
$this->journal_special_editor_obj->insert();
|
||||
$insert['email'] = trim($data['email']);
|
||||
$insert['first_name'] = trim($data['first_name']);
|
||||
$insert['last_name'] = trim($data['last_name']);
|
||||
$insert['address'] = trim($data['address']);
|
||||
$insert['interests'] = trim($data['interests']);
|
||||
$insert['website'] = trim($data['website']);
|
||||
$insert['orcid'] = trim($data['orcid']);
|
||||
$insert['icon'] = trim($data['specialIcon']);
|
||||
$this->journal_special_editor_obj->insert($insert);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
@@ -234,16 +236,18 @@ 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 editSpecialEditor(){
|
||||
$data = $this->request->post();
|
||||
$update['email'] = $data['email'];
|
||||
$update['first_name'] = $data['first_name'];
|
||||
$update['last_name'] = $data['last_name'];
|
||||
$update['address'] = $data['address'];
|
||||
$update['interests'] = $data['interests'];
|
||||
$update['website'] = $data['website'];
|
||||
$update['orcid'] = $data['orcid'];
|
||||
$update['email'] = trim($data['email']);
|
||||
$update['first_name'] = trim($data['first_name']);
|
||||
$update['last_name'] = trim($data['last_name']);
|
||||
$update['address'] = trim($data['address']);
|
||||
$update['interests'] = trim($data['interests']);
|
||||
$update['website'] = trim($data['website']);
|
||||
$update['orcid'] = trim($data['orcid']);
|
||||
$update['icon'] = trim($data['specialIcon']);
|
||||
$this->journal_special_editor_obj->where('journal_special_editor_id',$data['journal_special_editor_id'])->update($update);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
@@ -272,6 +276,9 @@ class Special extends Controller {
|
||||
$list = $this->journal_special_editor_obj->where('journal_special_editor_id','not in',$cids)->where('state',0)->limit($limit_start,$data['pageSize'])->select();
|
||||
$count = $this->journal_special_editor_obj->where('journal_special_editor_id','not in',$cids)->where('state',0)->count();
|
||||
|
||||
foreach ($list as $k => $v){
|
||||
$list[$k]['specialIcon'] = $v['icon'];
|
||||
}
|
||||
$re['count'] = $count;
|
||||
$re['editors'] = $list;
|
||||
return jsonSuccess($re);
|
||||
@@ -396,4 +403,30 @@ class Special extends Controller {
|
||||
$this->journal_special_alert_obj->where('special_alert_id',$data['special_alert_id'])->update($update);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @title 头像图片上传
|
||||
* @description 头像图片上传
|
||||
* @author wangjinlei
|
||||
* @url /master/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