20201112
This commit is contained in:
@@ -102,15 +102,18 @@ class Journal extends Controller {
|
|||||||
* @param name:journal_id type:int require:1 desc:期刊id
|
* @param name:journal_id type:int require:1 desc:期刊id
|
||||||
*
|
*
|
||||||
* @return journal:期刊基础信息array#
|
* @return journal:期刊基础信息array#
|
||||||
|
* @return relats:关联数组#
|
||||||
* @return journalAbs:期刊外链信息array#
|
* @return journalAbs:期刊外链信息array#
|
||||||
* @return journalstage:期刊分期信息array#
|
* @return journalstage:期刊分期信息array#
|
||||||
*/
|
*/
|
||||||
public function getJournal() {
|
public function getJournal() {
|
||||||
$data = $this->request->post();
|
$data = $this->request->post();
|
||||||
$journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find();
|
$journal_info = $this->journal_obj->where('journal_id', $data['journal_id'])->find();
|
||||||
|
$rearr = $journal_info['relate']==''?[]:explode(',',$journal_info['relate']);
|
||||||
|
$relatelist = $this->journal_obj->where('journal_id','in',$rearr)->where('state',0)->select();
|
||||||
$absList = $this->journal_abs_obj->where('journal_id', $data['journal_id'])->where('state', 0)->order('sort')->select();
|
$absList = $this->journal_abs_obj->where('journal_id', $data['journal_id'])->where('state', 0)->order('sort')->select();
|
||||||
$stageList = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('is_publish', 1)->where('state', 0)->order('journal_stage_id desc')->select();
|
$stageList = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where('is_publish', 1)->where('state', 0)->order('journal_stage_id desc')->select();
|
||||||
return json(['code' => 0, 'msg' => 'success', 'data' => ['journal' => $journal_info, 'journalAbs' => $absList, 'journalStage' => $stageList]]);
|
return json(['code' => 0, 'msg' => 'success', 'data' => ['journal' => $journal_info,'relats'=>$relatelist ,'journalAbs' => $absList, 'journalStage' => $stageList]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -70,6 +70,24 @@ class Journal extends Controller {
|
|||||||
return json(['code'=>0,'msg'=>'success','data'=>['journalList'=>$res]]);
|
return json(['code'=>0,'msg'=>'success','data'=>['journalList'=>$res]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 获取所有期刊
|
||||||
|
* @description 获取所有期刊
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /master/Journal/getJournalAll
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* @param name:journal_id type:int require:1 desc:当前期刊id
|
||||||
|
*
|
||||||
|
* @return journalList:期刊列表#
|
||||||
|
*/
|
||||||
|
public function getJournalAll(){
|
||||||
|
$data = $this->request->post();
|
||||||
|
$res = $this->journal_obj->where('journal_id','<>',$data['journal_id'])->where('state',0)->select();
|
||||||
|
$re['journalList'] = $res;
|
||||||
|
return jsonSuccess($re);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 添加期刊
|
* @title 添加期刊
|
||||||
@@ -1099,6 +1117,75 @@ class Journal extends Controller {
|
|||||||
return jsonSuccess($re);
|
return jsonSuccess($re);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 增加期刊关联期刊
|
||||||
|
* @description 增加期刊关联期刊
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /master/Journal/addJournalralet
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* @param name:journal_id type:int require:1 desc:期刊id
|
||||||
|
* @param name:relat_id type:int require:1 desc:关联期刊id
|
||||||
|
*/
|
||||||
|
public function addJournalralet(){
|
||||||
|
$data = $this->request->post();
|
||||||
|
$journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
|
||||||
|
$rearr = $journal_info['relate']==''?[]:explode(',',$journal_info['relate']);
|
||||||
|
if(count($rearr)>3){
|
||||||
|
return jsonError('No more than four');
|
||||||
|
}
|
||||||
|
$rearr[] = $data['relat_id'];
|
||||||
|
|
||||||
|
$this->journal_obj->where('journal_id',$data['journal_id'])->update(['relate'=> implode(',', $rearr)]);
|
||||||
|
return jsonSuccess([]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 删除期刊关联期刊
|
||||||
|
* @description 删除期刊关联期刊
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /master/Journal/delJournalralet
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* @param name:journal_id type:int require:1 desc:期刊id
|
||||||
|
* @param name:relat_id type:int require:1 desc:关联期刊id
|
||||||
|
*/
|
||||||
|
public function delJournalralet(){
|
||||||
|
$data = $this->request->post();
|
||||||
|
$journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
|
||||||
|
$rearr = $journal_info['relate']==''?[]:explode(',',$journal_info['relate']);
|
||||||
|
foreach ($rearr as $k => $v){
|
||||||
|
if($v == $data['relat_id']){
|
||||||
|
unset($rearr[$k]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->journal_obj->where('journal_id',$data['journal_id'])->update(['relate'=> implode(',', $rearr)]);
|
||||||
|
return jsonSuccess([]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @title 获取期刊关联期刊
|
||||||
|
* @description 获取期刊关联期刊
|
||||||
|
* @author wangjinlei
|
||||||
|
* @url /master/Journal/getJournalralet
|
||||||
|
* @method POST
|
||||||
|
*
|
||||||
|
* @param name:journal_id type:int require:1 desc:期刊id
|
||||||
|
*
|
||||||
|
* @return journal:当前期刊#
|
||||||
|
* @return journals:期刊array#
|
||||||
|
*/
|
||||||
|
public function getJournalralet(){
|
||||||
|
$data = $this->request->post();
|
||||||
|
$journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
|
||||||
|
$rearr = $journal_info['relate']==''?[]:explode(',',$journal_info['relate']);
|
||||||
|
$list = $this->journal_obj->where('journal_id','in',$rearr)->where('state',0)->select();
|
||||||
|
|
||||||
|
$re['journal'] = $journal_info;
|
||||||
|
$re['journals'] = $list;
|
||||||
|
return jsonSuccess($re);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @title 增加期刊line文章
|
* @title 增加期刊line文章
|
||||||
* @description 增加期刊line文章
|
* @description 增加期刊line文章
|
||||||
|
|||||||
Reference in New Issue
Block a user