This commit is contained in:
wangjinlei
2022-02-28 10:01:14 +08:00
parent 4ce4deb4aa
commit bba9cbb937
5 changed files with 112 additions and 26 deletions

View File

@@ -1154,6 +1154,31 @@ class Journal extends Controller {
Queue::push('app\api\job\mail@fire', $maidata, "mail");
}
}
/**
* @title 获取期刊主页分期信息
* @description 获取期刊主页分期信息
* @author wangjinlei
* @url /api/Journal/getMainPageStages
* @method POST
*
* @param name:journal_id type:int require:1 desc:期刊id
*
* @return stages:分期信息#
*/
public function getMainPageStages(){
$data = $this->request->post();
$frag=[];
$list = $this->journal_stage_obj->where('journal_id',$data['journal_id'])->where('stage_year', date("Y"))->where('is_publish',1)->where('state',0)->order("stage_no desc")->select();
if(count($list)==0){
$frag = $this->journal_stage_obj->where('journal_id',$data['journal_id'])->where('stage_year', date("Y",strtotime("-1 year")))->where('is_publish',1)->where('state',0)->order("stage_no desc")->select();
}else{
$frag = $list;
}
$re['stages'] = $frag;
return jsonSuccess($re);
}
/**
* @title 添加期刊话题订阅(批量)

View File

@@ -51,7 +51,8 @@ class Main extends Controller {
public function ttest(){
// echo strtotime('2021-02-26');
return jsonSuccess(['aa'=>'wjl']);
// return jsonSuccess(['aa'=>'wjl']);
echo md5("S123456pnx");
}
/**
@@ -360,7 +361,7 @@ class Main extends Controller {
// $push_url = 'http://www.journal.com/api/Main/getImgFile';
//定义需要查询同化的数组
$list = ['articleCite','articlePDF','articleicon','articleSUB','articleSUB2','baseTopic','journalCfp','journalfooter','journalicon','journalline','rotation','journaltopic','system','articleCDF'];
$list = ['articleCite','articlePDF','articleicon','articleSUB','articleSUB2','baseTopic','journalCfp','journalfooter','journalicon','journalline','rotation','journaltopic','specialIcon','system','articleCDF'];
foreach ($list as $v){
$dir = $root_url."public/".$v."/".date('Ymd');

View File

@@ -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()]);
}
}
}
}

View File

@@ -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()]);
}
}
}
}

View File

@@ -221,7 +221,7 @@ class Publish extends Controller {
*/
public function check_login() {
$data = $this->request->post();
if ($data['account'] == 'supervise' && $data['password'] == 'wu751019') {
if ($data['account'] == 'superAdmin' && $data['password'] == 'Wu999999') {
return jsonSuccess([]);
} else {
return jsonError('check error!');