1
This commit is contained in:
@@ -115,6 +115,29 @@ class Journal extends Controller {
|
||||
$re['stages']=$list;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取期刊和分期信息
|
||||
*/
|
||||
public function getJournalsAndStage(){
|
||||
$data = $this->request->post();
|
||||
$journal_list = $this->journal_obj->where('state', 0)->select();
|
||||
$frag = [];
|
||||
foreach ($journal_list as $v) {
|
||||
// $v['journal_stage_id'] = $v['journal_id'];
|
||||
$cache_list = $this->journal_stage_obj->where('journal_id', $v['journal_id'])->where('state', 0)->select();
|
||||
foreach ($cache_list as $k => $vv) {
|
||||
$cache_list[$k]['title'] = $vv['stage_year'] . ' Vol.' . $vv['stage_vol'] . ' issue.' . $vv['stage_no'] . $vv['stage_pagename'] . $vv['stage_page'];
|
||||
}
|
||||
if (count($cache_list) > 0) {
|
||||
$v['children'] = $cache_list;
|
||||
} else {
|
||||
$v['children'] = [];
|
||||
}
|
||||
$frag[] = $v;
|
||||
}
|
||||
return json(['code' => 0, 'msg' => 'success', 'data' => ['joutaglist' => $frag]]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取所有期刊
|
||||
|
||||
@@ -85,13 +85,18 @@ class Medicament extends Controller
|
||||
public function delMedicament(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
'article_id'=>'require',
|
||||
'med_id'=>'require'
|
||||
'article_id'=>'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$this->article_to_medicament_obj->where('article_id',$data['article_id'])->where('med_id',$data['med_id'])->update(['med_state'=>1]);
|
||||
$atm_info = $this->article_to_medicament_obj->where('article_id',$data['article_id'])->where('atm_state',0)->find();
|
||||
//确定此关联的药剂话题项目是否有其他关联文章,决定是否删除连带的药剂话题
|
||||
$check = $this->article_to_medicament_obj->where('med_id',$atm_info['med_id'])->where('atm_id','<>',$atm_info['atm_id'])->where('atm_state',0)->find();
|
||||
if($check==null){
|
||||
$this->medicament_obj->where('med_id',$atm_info['med_id'])->update(['med_state'=>1]);
|
||||
}
|
||||
$this->article_to_medicament_obj->where('article_id',$data['article_id'])->where('atm_state',0)->update(['atm_state'=>1]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user