1
This commit is contained in:
@@ -527,13 +527,67 @@ class Article extends Controller {
|
||||
$journal_info = $this->journal_obj->where('issn',$data['issn'])->find();
|
||||
$stages = $this->journal_stage_obj->where('is_publish',0)->where('journal_id',$journal_info['journal_id'])->where('state',0)->select();
|
||||
foreach($stages as $k => $v){
|
||||
$cache = $this->article_obj->where('journal_stage_id',$v['journal_stage_id'])->where('state',0)->select();
|
||||
$cache = $this->article_obj->where('journal_stage_id',$v['journal_stage_id'])->where('state',0)->orderRaw('npp+0')->select();
|
||||
$stages[$k]['articles'] = $cache;
|
||||
}
|
||||
$re['stages'] = $stages;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取public文章
|
||||
*/
|
||||
public function getArticleForSubmit(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
'issn'=>'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$journal_info = $this->journal_obj->where('issn',$data['issn'])->find();
|
||||
$stages = $this->journal_stage_obj->where('journal_id',$journal_info['journal_id'])->where('state',0)->select();
|
||||
foreach($stages as $k => $v){
|
||||
$cache = $this->article_obj->where('journal_stage_id',$v['journal_stage_id'])->where('state',0)->orderRaw('npp+0')->select();
|
||||
$stages[$k]['articles'] = $cache;
|
||||
}
|
||||
$re['stages'] = $stages;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有分期
|
||||
*/
|
||||
public function getAllStagesForSubmit(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
'issn'=>'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$journal_info = $this->journal_obj->where('issn',$data['issn'])->find();
|
||||
$stages = $this->journal_stage_obj->where('journal_id',$journal_info['journal_id'])->where('state',0)->select();
|
||||
$re['stages'] = $stages;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更改文章客座
|
||||
*/
|
||||
public function changeArticleSpecialForSubmit(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
'article_id'=>'require',
|
||||
'journal_special_id'=>'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$this->article_obj->where('article_id',$data['article_id'])->update(['journal_special_id'=>$data['journal_special_id']]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
// public function authortest(){
|
||||
// $str = "[{\"art_aut_id\":6474,\"article_id\":2065,\"firstname\":\"Tadele\",\"lastname\":\"Yadesa\",\"orcid\":\"https:\\/\\/orcid.org\\/ 0000-0001-5151-2610\",\"company\":\"Mbarara University of Science and Technology\",\"department\":\"Pharmacy\",\"email\":\"maatiikoo4@gmail.com\",\"author_title\":\"Ph.D.\",\"country\":\"Uganda\",\"address\":\"Mbarara University of Science and Technology P.O.BOX 1410\",\"is_super\":1,\"is_report\":1,\"state\":0},{\"art_aut_id\":6475,\"article_id\":2065,\"firstname\":\"Oliver\",\"lastname\":\"Kushemererwa\",\"orcid\":\"\",\"company\":\"Mbarara University of Science and Technology\",\"department\":\"Pharmacy\",\"email\":\"Kusholiver@gmail.com\",\"author_title\":\"Others\",\"country\":\"Uganda\",\"address\":\"\",\"is_super\":0,\"is_report\":0,\"state\":0},{\"art_aut_id\":6476,\"article_id\":2065,\"firstname\":\"Joshua\",\"lastname\":\"Kiptoo\",\"orcid\":\"\",\"company\":\"Mbarara University of Science and Technology\",\"department\":\"Pharmacy\",\"email\":\"KIPTOOKWALIA@gmail.com\",\"author_title\":\"Others\",\"country\":\"Uganda\",\"address\":\"\",\"is_super\":0,\"is_report\":0,\"state\":0},{\"art_aut_id\":6477,\"article_id\":2065,\"firstname\":\"John\",\"lastname\":\"Isiiko\",\"orcid\":\"\",\"company\":\"Mbarara University of Science and Technology\",\"department\":\"Pharmacy\",\"email\":\"isiikojohn@gmail.com\",\"author_title\":\"Others\",\"country\":\"Uganda\",\"address\":\"\",\"is_super\":0,\"is_report\":0,\"state\":0},{\"art_aut_id\":6478,\"article_id\":2065,\"firstname\":\"Bonny\",\"lastname\":\"Luzze\",\"orcid\":\"\",\"company\":\"Mbarara University of Science and Technology\",\"department\":\"Pharmacy\",\"email\":\"tottojrlz@gmail.com\",\"author_title\":\"Others\",\"country\":\"Uganda\",\"address\":\"\",\"is_super\":0,\"is_report\":0,\"state\":0},{\"art_aut_id\":6479,\"article_id\":2065,\"firstname\":\"Jacinta\",\"lastname\":\"Ojia\",\"orcid\":\"\",\"company\":\"Mbarara University of Science and Technology\",\"department\":\"Internal medicine\",\"email\":\"ambark21@yahoo.com\",\"author_title\":\"Others\",\"country\":\"Uganda\",\"address\":\"\",\"is_super\":0,\"is_report\":0,\"state\":0},{\"art_aut_id\":6480,\"article_id\":2065,\"firstname\":\"Mohamed\",\"lastname\":\"Abdirahman\",\"orcid\":\"\",\"company\":\"Mbarara University of Science and Technology\",\"department\":\"Internal medicine\",\"email\":\"dr.mma001838@gmail.com\",\"author_title\":\"Others\",\"country\":\"Uganda\",\"address\":\"\",\"is_super\":1,\"is_report\":0,\"state\":0}]";
|
||||
@@ -732,6 +786,37 @@ class Article extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取关键词文章
|
||||
*/
|
||||
public function getKeywordArticleOrderJournalForSubmit(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
'keyword'=>'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$articles = $this->article_obj
|
||||
->field('j_article.*,j_journal.title journal_title')
|
||||
->join('j_journal','j_journal.journal_id = j_article.journal_id','left')
|
||||
->where('j_article.title|j_article.abstract|j_article.keywords','like',"%".$data['keyword']."%")
|
||||
->where('j_article.state',0)->order('journal_id')
|
||||
->select();
|
||||
$journals = [];
|
||||
foreach($articles as $v){
|
||||
if(!isset($journals[$v['journal_title']])){
|
||||
$cache_journal = $this->journal_obj->where('journal_id',$v['journal_id'])->find();
|
||||
$journals[$cache_journal['title']] = $cache_journal;
|
||||
$journals[$cache_journal['title']]['articles'] = [];
|
||||
}
|
||||
$journals[$v['journal_title']]['articles'][] = $v;
|
||||
}
|
||||
$re['journals'] = array_values($journals);
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 编辑文章文件信息
|
||||
* @description 编辑文章文件信息
|
||||
@@ -826,6 +911,50 @@ class Article extends Controller {
|
||||
return json(['code' => 0, 'msg' => 'success', 'data' => ['count' => $count, 'articleList' => $article_list]]);
|
||||
}
|
||||
|
||||
public function getArticleListForSubmit() {
|
||||
$data = $this->request->post();
|
||||
$where['j_article.state'] = 0;
|
||||
$journal_info = $this->journal_obj->where('issn',$data['issn'])->find();
|
||||
$where['j_article.journal_id'] = $journal_info['journal_id'];
|
||||
if (intval($data['journal_stage_id']) !== 0) {
|
||||
$where['j_article.journal_stage_id'] = $data['journal_stage_id'];
|
||||
}
|
||||
if (isset($data['seach']) && $data['seach'] != '') {
|
||||
$where['j_article.title'] = ['like', '%' . $data['seach'] . '%'];
|
||||
}
|
||||
$where['j_journal_stage.is_publish']=1;
|
||||
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
|
||||
$article_list = $this->article_obj->field('j_article.*,j_journal_stage.*,j_journal.title journal_title')
|
||||
->join(array(['j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'LEFT'], ['j_journal', 'j_journal.journal_id=j_article.journal_id', 'LEFT']))
|
||||
->where($where)
|
||||
->order('j_journal_stage.journal_stage_id desc')
|
||||
->orderRaw('j_article.npp+0')
|
||||
->limit($limit_start, $data['pageSize'])
|
||||
->select();
|
||||
foreach ($article_list as $k => $v) {
|
||||
$caches = $this->article_ltai_obj->where('article_id', $v['article_id'])->where('state', 0)->column('content');
|
||||
$cache_title = $v['title'];
|
||||
foreach ($caches as $val) {
|
||||
$cache_title = str_replace($val, '<i>' . $val . '</i>', $cache_title);
|
||||
}
|
||||
$article_list[$k]['title'] = $cache_title;
|
||||
//获取药剂信息
|
||||
$atm = $this->article_to_medicament_obj->where('article_id',$v['article_id'])->where('atm_state',0)->find();
|
||||
if($atm){
|
||||
$med_info = $this->medicament_obj->where('med_id',$atm['med_id'])->where('med_state',0)->find();
|
||||
$article_list[$k]['med_title'] = $med_info['med_title'];
|
||||
$article_list[$k]['med_ename'] = $med_info['med_ename'];
|
||||
}else{
|
||||
$article_list[$k]['med_title'] = '';
|
||||
$article_list[$k]['med_ename'] = '';
|
||||
}
|
||||
}
|
||||
$count = $this->article_obj
|
||||
->join(array(['j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'LEFT'], ['j_journal', 'j_journal.journal_id=j_article.journal_id', 'LEFT']))
|
||||
->where($where)->count();
|
||||
return json(['code' => 0, 'msg' => 'success', 'data' => ['count' => $count, 'articleList' => $article_list]]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取文章对应期刊话题
|
||||
* @description 获取文章对应期刊话题
|
||||
@@ -886,8 +1015,8 @@ class Article extends Controller {
|
||||
$insert['article_id'] = $data['article_id'];
|
||||
$insert['topic_id'] = $data['topic_id'];
|
||||
$res = $this->article_to_topic_obj->insert($insert);
|
||||
$this->msg_subscript_topic($data['topic_id'], $data['article_id']);
|
||||
$this->msg_subscribe_base_topic($data['topic_id'], $data['article_id']);
|
||||
// $this->msg_subscript_topic($data['topic_id'], $data['article_id']);
|
||||
// $this->msg_subscribe_base_topic($data['topic_id'], $data['article_id']);
|
||||
if ($res) {
|
||||
return json(['code' => 0, 'msg' => 'success']);
|
||||
} else {
|
||||
|
||||
@@ -480,7 +480,7 @@ class Datebase extends Controller
|
||||
$zip->addFile($base_dir . '/' . $v["npp"] . ".pdf", $v["npp"] . ".pdf");
|
||||
}
|
||||
//添加封面图片
|
||||
copy("https://www.tmrjournals.com/public/journalicon/" . $journal_info["icon"], $base_dir . "/journal.jpg");
|
||||
copy("https://www.tmrjournals.com/public/" . $stage_info["stage_icon"], $base_dir . "/journal.jpg");
|
||||
$zip->addFile($base_dir . "/journal.jpg", "journal.jpg");
|
||||
$zip->close();
|
||||
}
|
||||
|
||||
@@ -1581,6 +1581,26 @@ class Journal extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 出刊自动化
|
||||
*/
|
||||
public function pushJournalPublishForSubmit(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
'journal_stage_id'=>'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$old = $this->journal_stage_obj->where('journal_stage_id', $data['journal_stage_id'])->find();
|
||||
$this->journal_stage_obj->where('journal_stage_id',$data['journal_stage_id'])->update(['is_publish'=>1]);
|
||||
$this->journal_obj->where('journal_id',$old['journal_id'])->update(['publish_stage_id'=>$data['journal_stage_id']]);
|
||||
$this->msg_subscript_journal($data['journal_stage_id'], $old['journal_id']);
|
||||
// 提醒作者 发送邮件
|
||||
$this->sendAuthor($data['journal_stage_id'], $old['journal_id']);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private function msg_subscript_journal($journal_stage_id, $journal_id)
|
||||
|
||||
Reference in New Issue
Block a user