This commit is contained in:
@@ -215,8 +215,8 @@ class Article extends Controller {
|
||||
->join(array(['j_article', 'j_article_to_topic.article_id = j_article.article_id', 'LEFT'], ['j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'LEFT']))
|
||||
->where('j_article_to_topic.topic_id', $data['topic_id'])
|
||||
->where('j_article_to_topic.state', 0)
|
||||
->where('j_journal_stage.stage_year','>',intval(date('Y'))-3)
|
||||
->orderRaw('(abs_num+pdf_num) desc')
|
||||
// ->where('j_journal_stage.stage_year','>',intval(date('Y'))-3)
|
||||
->orderRaw('j_journal_stage.stage_year desc ,(abs_num+pdf_num) desc')
|
||||
// ->order('j_article.journal_stage_id desc , j_article.article_id desc')
|
||||
->limit($limit_start,$data['pageSize'])
|
||||
->select();
|
||||
@@ -224,7 +224,7 @@ class Article extends Controller {
|
||||
->join(array(['j_article', 'j_article_to_topic.article_id = j_article.article_id', 'LEFT'], ['j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'LEFT']))
|
||||
->where('j_article_to_topic.topic_id', $data['topic_id'])
|
||||
->where('j_article_to_topic.state', 0)
|
||||
->where('j_journal_stage.stage_year','>',intval(date('Y'))-3)
|
||||
// ->where('j_journal_stage.stage_year','>',intval(date('Y'))-3)
|
||||
->count();
|
||||
//获取作者
|
||||
foreach ($list as $k => $v) {
|
||||
@@ -283,7 +283,8 @@ class Article extends Controller {
|
||||
$data = $this->request->post();
|
||||
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $data['stage_id'])->find();
|
||||
$journal_info = $this->journal_obj->where('journal_id',$stage_info['journal_id'])->find();
|
||||
$list = $this->article_obj->field('j_article.*,j_journal_stage.*')
|
||||
$list = $this->article_obj->field('j_article.*,j_journal_stage.*,j_journal.title journal_title')
|
||||
->join("j_journal",'j_journal.journal_id = j_article.journal_id','left')
|
||||
->join('j_journal_stage', 'j_article.journal_stage_id = j_journal_stage.journal_stage_id', 'LEFT')
|
||||
->where('j_article.journal_stage_id', $data['stage_id'])
|
||||
->where('j_article.state', 0)
|
||||
@@ -310,8 +311,9 @@ class Article extends Controller {
|
||||
}
|
||||
$list[$k]['title'] = $cache_title;
|
||||
}
|
||||
$l = choiseJtitle($list);
|
||||
$re['stageInfo'] = $stage_info;
|
||||
$re['articleList'] = $list;
|
||||
$re['articleList'] = $l;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ function choiseJabbr($article_id,$jabbr){
|
||||
if($article_id<1821&&$jabbr=="Clin Res Commun"){
|
||||
return "TMR Clin Res";
|
||||
}
|
||||
if($article_id<1700&&$jabbr=="Aging Commun"){
|
||||
if($article_id<1665&&$jabbr=="Aging Commun"&&$article_id!=1612){
|
||||
return "TMR Aging";
|
||||
}
|
||||
if($article_id<1869&&$jabbr=="Nurs Commun"){
|
||||
@@ -61,6 +61,35 @@ function choiseJabbr($article_id,$jabbr){
|
||||
return $jabbr;
|
||||
}
|
||||
|
||||
function choiseJtitle($list){
|
||||
foreach ($list as $k => $v){
|
||||
$list[$k]['journal_title'] = choiseti($v);
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
function choiseti($v){
|
||||
if($v['article_id']<1799&&$v['journal_title']=="Cancer Advances"){
|
||||
return "TMR Cancer";
|
||||
}
|
||||
if($v['article_id']<910&&$v['journal_title']=="Microenvironment & Microecology Research"){
|
||||
return "Tumor Microenvironment Research";
|
||||
}
|
||||
if($v['article_id']<1799&&$v['journal_title']=="Medical Theory and Hypothesis"){
|
||||
return "TMR Theory and Hypothesis";
|
||||
}
|
||||
if($v['article_id']<1821&&$v['journal_title']=="Clinical Research Communications"){
|
||||
return "TMR Clinical Research";
|
||||
}
|
||||
if($v['article_id']<1665&&$v['journal_title']=="Aging Communications"&&$v['article_id']!=1612){
|
||||
return "TMR Aging";
|
||||
}
|
||||
if($v['article_id']<1869&&$v['journal_title']=="Nursing Communications"){
|
||||
return "TMR Integrative Nursing";
|
||||
}
|
||||
return $v['journal_title'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @function sendEmail
|
||||
* @intro 发送邮件(带附件)
|
||||
|
||||
55
application/master/controller/Major.php
Normal file
55
application/master/controller/Major.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
namespace app\master\controller;
|
||||
|
||||
use think\Controller;
|
||||
use think\Db;
|
||||
|
||||
|
||||
class Major extends Controller
|
||||
{
|
||||
protected $admin_obj = '';
|
||||
protected $major_obj = '';
|
||||
protected $major_to_journal_obj = '';
|
||||
|
||||
public function __construct(\think\Request $request = null) {
|
||||
parent::__construct($request);
|
||||
$this->admin_obj = Db::name('admin');
|
||||
$this->major_obj = Db::name('major');
|
||||
$this->major_to_journal_obj = Db::name("major_to_journal");
|
||||
}
|
||||
|
||||
|
||||
public function sync_all(){
|
||||
$data = $this->request->post();
|
||||
// $majors = json_decode($data['majors']);
|
||||
// $major = "[{\"major_id\":1,\"major_title\":\"Medicine\",\"major_level\":1,\"pid\":0,\"nickname\":\"\",\"major_sort\":0,\"major_ctime\":1641546586,\"major_state\":0},{\"major_id\":2,\"major_title\":\"Food\",\"major_level\":2,\"pid\":1,\"nickname\":\"\\u98df\\u54c1\",\"major_sort\":0,\"major_ctime\":1641546644,\"major_state\":0},{\"major_id\":3,\"major_title\":\"Functional food\",\"major_level\":3,\"pid\":2,\"nickname\":\"\\u529f\\u80fd\\u98df\\u54c1\",\"major_sort\":0,\"major_ctime\":1641546672,\"major_state\":0},{\"major_id\":4,\"major_title\":\"Therapeutic Diet\",\"major_level\":3,\"pid\":2,\"nickname\":\"\\u6cbb\\u7597\\u98df\\u54c1\",\"major_sort\":0,\"major_ctime\":1641546978,\"major_state\":0},{\"major_id\":5,\"major_title\":\"Food Safety\",\"major_level\":3,\"pid\":2,\"nickname\":\"\\u98df\\u54c1\\u5b89\\u5168\",\"major_sort\":0,\"major_ctime\":1641546997,\"major_state\":0},{\"major_id\":6,\"major_title\":\"Nutriology\",\"major_level\":2,\"pid\":1,\"nickname\":\"\\u8425\\u517b\\u5b66\",\"major_sort\":0,\"major_ctime\":1641547029,\"major_state\":0},{\"major_id\":7,\"major_title\":\"Pharmacology\",\"major_level\":2,\"pid\":1,\"nickname\":\"\\u836f\\u7406\\u5b66\",\"major_sort\":0,\"major_ctime\":1641547052,\"major_state\":0},{\"major_id\":8,\"major_title\":\"Network Pharmacology\",\"major_level\":3,\"pid\":7,\"nickname\":\"\\u7f51\\u7edc\\u836f\\u7406\\u5b66\",\"major_sort\":0,\"major_ctime\":1641547065,\"major_state\":0},{\"major_id\":9,\"major_title\":\"Combination of Herbs\",\"major_level\":3,\"pid\":7,\"nickname\":\"\\u8349\\u836f\\u8054\\u5408\\u5e94\\u7528\",\"major_sort\":0,\"major_ctime\":1641547271,\"major_state\":0},{\"major_id\":10,\"major_title\":\"Herbal Pharmacology\",\"major_level\":3,\"pid\":7,\"nickname\":\"\\u6574\\u5408\\u836f\\u7406\\u5b66\\uff08\\u5373\\u8349\\u836f\\u836f\\u7406\\u5b66\\uff09\",\"major_sort\":0,\"major_ctime\":1641547286,\"major_state\":0}]";
|
||||
$majors = object_to_array(json_decode($data['majors']));
|
||||
foreach ($majors as $v){
|
||||
$check = $this->major_obj->where('major_id',$v['major_id'])->find();
|
||||
if($check){
|
||||
$this->major_obj->update($v);
|
||||
}else{
|
||||
$this->major_obj->insert($v);
|
||||
}
|
||||
}
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
public function sync_journal(){
|
||||
$data = $this->request->post();
|
||||
$mtjs = object_to_array(json_decode($data['majors']));
|
||||
foreach ($mtjs as $v){
|
||||
$check = $this->major_to_journal_obj->where('mtj_id',$v['mtj_id'])->find();
|
||||
if($check){
|
||||
$this->major_to_journal_obj->update($v);
|
||||
}else{
|
||||
$this->major_to_journal_obj->insert($v);
|
||||
}
|
||||
}
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user