journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find();
//组合cite信息
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
- $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
- $cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
+ $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
+ $cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic', 'j_journal_topic.journal_topic_id = j_article_to_topic.topic_id', 'left')->where('j_article_to_topic.article_id', $v['article_id'])->where('j_article_to_topic.state', 0)->select();
$list[$k]['topic'] = $cache_topic;
$list[$k]['cite'] = $cite;
$list[$k]['authortitle'] = $this->getAuthor($v);
}
+
+ //连续出版判断,决定是否显示出版时间
+ foreach ($list as $k => $v) {
+ $ca_stage = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find();
+ if (($v['journal_id'] == 2 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 18 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 17 && $ca_stage['stage_year'] >= 2019)) {
+ $list[$k]['isShowOtime'] = 1;
+ } else {
+ $list[$k]['isShowOtime'] = 0;
+ }
+ }
return json(['code' => 0, 'msg' => 'success', 'data' => ['articlelist' => $list, 'count' => $count]]);
}
@@ -687,8 +725,8 @@ class Journal extends Controller {
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find();
//组合cite信息
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
- $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
- $cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
+ $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
+ $cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic', 'j_journal_topic.journal_topic_id = j_article_to_topic.topic_id', 'left')->where('j_article_to_topic.article_id', $v['article_id'])->where('j_article_to_topic.state', 0)->select();
$list[$k]['topic'] = $cache_topic;
$list[$k]['cite'] = $cite;
@@ -704,6 +742,16 @@ class Journal extends Controller {
$list[$k]['title'] = $cache_title;
}
+ //连续出版判断,决定是否显示出版时间
+ foreach ($list as $k => $v) {
+ $ca_stage = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find();
+ if (($v['journal_id'] == 2 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 18 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 17 && $ca_stage['stage_year'] >= 2019)) {
+ $list[$k]['isShowOtime'] = 1;
+ } else {
+ $list[$k]['isShowOtime'] = 0;
+ }
+ }
+
return json(['code' => 0, 'msg' => 'success', 'data' => ['articlelist' => $list]]);
}
@@ -740,19 +788,32 @@ class Journal extends Controller {
->where('j_article.state', 0)
->where('j_journal_stage.is_publish', 1)
->count();
+
+ if($count>50){//只显示前50片
+ $count = 50;
+ }
//获取作者
foreach ($list as $k => $v) {
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find();
//组合cite信息
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
- $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
- $cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
+ $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
+ $cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic', 'j_journal_topic.journal_topic_id = j_article_to_topic.topic_id', 'left')->where('j_article_to_topic.article_id', $v['article_id'])->where('j_article_to_topic.state', 0)->select();
$list[$k]['topic'] = $cache_topic;
$list[$k]['cite'] = $cite;
$list[$k]['authortitle'] = $this->getAuthor($v);
}
+ //连续出版判断,决定是否显示出版时间
+ foreach ($list as $k => $v){
+ $ca_stage = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find();
+ if(($v['journal_id']==2&&$ca_stage['stage_year']>=2022)||($v['journal_id']==18&&$ca_stage['stage_year']>=2022)||($v['journal_id']==17&&$ca_stage['stage_year']>=2019)){
+ $list[$k]['isShowOtime'] = 1;
+ }else{
+ $list[$k]['isShowOtime'] = 0;
+ }
+ }
//标题斜体
foreach ($list as $k => $v) {
@@ -832,8 +893,8 @@ class Journal extends Controller {
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find();
//组合cite信息
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
- $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
- $cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
+ $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
+ $cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic', 'j_journal_topic.journal_topic_id = j_article_to_topic.topic_id', 'left')->where('j_article_to_topic.article_id', $v['article_id'])->where('j_article_to_topic.state', 0)->select();
$list[$k]['topic'] = $cache_topic;
$list[$k]['cite'] = $cite;
@@ -848,6 +909,15 @@ class Journal extends Controller {
}
$list[$k]['title'] = $cache_title;
}
+ //连续出版判断,决定是否显示出版时间
+ foreach ($list as $k => $v) {
+ $ca_stage = $this->journal_stage_obj->where('journal_stage_id', $v['journal_stage_id'])->find();
+ if (($v['journal_id'] == 2 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 18 && $ca_stage['stage_year'] >= 2022) || ($v['journal_id'] == 17 && $ca_stage['stage_year'] >= 2019)) {
+ $list[$k]['isShowOtime'] = 1;
+ } else {
+ $list[$k]['isShowOtime'] = 0;
+ }
+ }
return jsonSuccess(['topic_info' => $topic_info, 'articlelist' => $list]);
} else {
@@ -1013,34 +1083,32 @@ class Journal extends Controller {
$re['topics'] = $list;
return jsonSuccess($re);
}
-
- public function tttt(){
- $host="localhost";//mysql服务器地址
- $user='root';
- $pass='root';
- $dbName='journal';//数据可名称
- $charSet='utf8';
- $port='3306';
- $conn=mysql_connect($host,$user,$padd);
- if(!$conn){
- echo 'unable to connect to DB '.mysql_error();
- exit();
- }
- query('use '.$db);
+
+ public function tttt() {
+ $host = "localhost"; //mysql服务器地址
+ $user = 'root';
+ $pass = 'root';
+ $dbName = 'journal'; //数据可名称
+ $charSet = 'utf8';
+ $port = '3306';
+ $conn = mysql_connect($host, $user, $padd);
+ if (!$conn) {
+ echo 'unable to connect to DB ' . mysql_error();
+ exit();
+ }
+ query('use ' . $db);
- $sql = "select * from j_user limit 1";//这里是sql语句
+ $sql = "select * from j_user limit 1"; //这里是sql语句
- $res = getAll($sql);
+ $res = getAll($sql);
- echo '';
- var_dump($res);
- echo '
';
+ echo '';
+ var_dump($res);
+ echo '
';
}
-
-
/**
* @title 添加期刊订阅
@@ -1066,7 +1134,7 @@ class Journal extends Controller {
$insert['journal_id'] = $data['journal_id'];
$insert['email'] = $data['email'];
$id = $this->subscribe_journal_obj->insertGetId($insert);
- $journal_info = $this->journal_obj->where("journal_id",$data['journal_id'])->find();
+ $journal_info = $this->journal_obj->where("journal_id", $data['journal_id'])->find();
//发送邮件感谢
$tt = 'Dear Researcher,
';
$tt .= 'Welcome you to the email alert for the latest research and more. Thank you for your interest in our publications and topics.
';
@@ -1076,7 +1144,7 @@ class Journal extends Controller {
$tt .= 'Email: publisher@tmrjournals.com';
$tt .= 'www.tmrjournals.com';
$maidata['email'] = $data['email'];
- $maidata['title'] = $journal_info['title']." ISSN ".$journal_info['issn'];//'Traditional Medicine Research ISSN 2413-3973';
+ $maidata['title'] = $journal_info['title'] . " ISSN " . $journal_info['issn']; //'Traditional Medicine Research ISSN 2413-3973';
$maidata['content'] = $tt;
$maidata['tmail'] = 'publicrelations@tmrjournals.com';
$maidata['tpassword'] = 'pRWU999999';
@@ -1084,7 +1152,7 @@ class Journal extends Controller {
return jsonSuccess([]);
}
-
+
/**
* @title 添加期刊订阅通过issn
* @description 添加期刊订阅通过issn
@@ -1095,9 +1163,9 @@ class Journal extends Controller {
* @param name:issn type:string require:1 desc:issn号
* @param name:email type:string require:1 desc:邮件地址
*/
- public function addSubscribeByIssn(){
+ public function addSubscribeByIssn() {
$data = $this->request->post();
- $journal_info = $this->journal_obj->where('issn',$data['issn'])->find();
+ $journal_info = $this->journal_obj->where('issn', $data['issn'])->find();
//去重
$repeat = $this->subscribe_journal_obj
->where('journal_id', $journal_info['journal_id'])
@@ -1119,7 +1187,7 @@ class Journal extends Controller {
$tt .= 'Email: publisher@tmrjournals.com';
$tt .= 'www.tmrjournals.com';
$maidata['email'] = $data['email'];
- $maidata['title'] = $journal_info['title']." ISSN ".$journal_info['issn'];//'Traditional Medicine Research ISSN 2413-3973';
+ $maidata['title'] = $journal_info['title'] . " ISSN " . $journal_info['issn']; //'Traditional Medicine Research ISSN 2413-3973';
$maidata['content'] = $tt;
$maidata['tmail'] = 'publicrelations@tmrjournals.com';
$maidata['tpassword'] = 'pRWU999999';
@@ -1127,15 +1195,15 @@ class Journal extends Controller {
return jsonSuccess([]);
}
-
- public function pushEmail(){
+
+ public function pushEmail() {
die;
- $list = $this->subscribe_journal_obj->where('journal_id',1)->select();
-
+ $list = $this->subscribe_journal_obj->where('journal_id', 1)->select();
+
// $a = [];
// $a[] = ['email'=>'751475802@qq.com'];
// $a[] = ['email'=>'13662001490@126.com'];
- foreach ($list as $v){
+ foreach ($list as $v) {
$tt = 'Dear Researcher,
';
$tt .= 'We are so kindly to bring you a notice that we are glad to invite eminent people as the Reviewer for Traditional Medicine Research (ISSN 2413-3973).
';
$tt .= 'Traditional Medicine Research has been included in Emerging Sources Citation Index (ESCI), Embase, DOAJ, ProQuest, J-Gate, EuroPub, WHO-COVID-19 Database, Google Scholar, EBSCO, ect.
';
@@ -1154,7 +1222,7 @@ class Journal extends Controller {
Queue::push('app\api\job\mail@fire', $maidata, "mail");
}
}
-
+
/**
* @title 获取期刊主页分期信息
* @description 获取期刊主页分期信息
@@ -1166,16 +1234,16 @@ class Journal extends Controller {
*
* @return stages:分期信息#
*/
- public function getMainPageStages(){
+ 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 = $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);
}
@@ -1208,10 +1276,10 @@ class Journal extends Controller {
$insert['topic_id'] = $v;
$insert['email'] = $data['email'];
$id = $this->subscribe_topic_obj->insertGetId($insert);
- $cache_info = $this->journal_topic_obj->where('journal_topic_id',$v)->find();
- $str .= 'Unsubscribe topic->'.$cache_info['title'].'
';
+ $cache_info = $this->journal_topic_obj->where('journal_topic_id', $v)->find();
+ $str .= 'Unsubscribe topic->' . $cache_info['title'] . '
';
}
- if($str==''){
+ if ($str == '') {
return jsonError('repeat subscribe!');
}
//发送邮件感谢
@@ -1271,7 +1339,7 @@ class Journal extends Controller {
$res = Queue::push('app\api\job\mail@fire', $maidata, "mail");
return jsonSuccess([]);
}
-
+
/**
* @title 添加通用话题订阅
* @description 添加通用话题订阅
@@ -1282,7 +1350,7 @@ class Journal extends Controller {
* @param name:base_topic_id type:int require:1 desc:期刊话题id
* @param name:email type:string require:1 desc:邮箱地址
*/
- public function addSubscribeBaseTopic(){
+ public function addSubscribeBaseTopic() {
$data = $this->request->post();
//去重
$repeat = $this->subscribe_base_topic_obj
@@ -1312,14 +1380,14 @@ class Journal extends Controller {
Queue::push('app\api\job\mail@fire', $maidata, "mail");
return jsonSuccess([]);
}
-
+
public function UnsubscribeTopic($snum) {
$this->subscribe_topic_obj->where('subscribe_topic_id', $snum)->update(['state' => 1]);
echo 'Unsubscribe successfully!';
}
-
- public function UnsubscribeBaseTopic($snum){
- $this->subscribe_base_topic_obj->where('subscribe_base_topic_id',$snum)->update(['state'=>1]);
+
+ public function UnsubscribeBaseTopic($snum) {
+ $this->subscribe_base_topic_obj->where('subscribe_base_topic_id', $snum)->update(['state' => 1]);
echo 'Unsubscribe successfully!';
}
@@ -1362,7 +1430,7 @@ class Journal extends Controller {
public function searchArticle() {
$data = $this->request->post();
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
- $arts = $this->article_author_obj->where('state', 0)->where("author_name like '%" . str_replace("'","''",trim($data['keyword'])) . "%'")->column('article_id');
+ $arts = $this->article_author_obj->where('state', 0)->where("author_name like '%" . str_replace("'", "''", trim($data['keyword'])) . "%'")->column('article_id');
$list = $this->article_obj
->where('journal_id', $data['journal_id'])
->where('state', 0)
@@ -1370,9 +1438,9 @@ class Journal extends Controller {
// ->where('title like "%' . str_replace("'","''",trim($data['keyword'])) . '%" or abstract like "%' . str_replace("'","''",trim($data['keyword'])) . '%" or keywords like "%' . str_replace("'","''",trim($data['keyword'])) . '%"')
->where(function($query)use($arts, $data) {
$query->where('article_id', 'in', $arts)
- ->whereOr("`title` like '%" . str_replace("'","''",trim($data['keyword'])) . "%' or `abstract` like '%" . str_replace("'","''",trim($data['keyword'])) . "%' or `keywords` like '%" . str_replace("'","''",trim($data['keyword'])) . "%'");
+ ->whereOr("`title` like '%" . str_replace("'", "''", trim($data['keyword'])) . "%' or `abstract` like '%" . str_replace("'", "''", trim($data['keyword'])) . "%' or `keywords` like '%" . str_replace("'", "''", trim($data['keyword'])) . "%'");
})
- ->orderRaw("(CASE WHEN title LIKE '%" . str_replace("'","''",trim($data['keyword'])) . "%' THEN 1 ELSE 0 END) desc")
+ ->orderRaw("(CASE WHEN title LIKE '%" . str_replace("'", "''", trim($data['keyword'])) . "%' THEN 1 ELSE 0 END) desc")
->limit($limit_start, $data['pageSize'])
->select();
$count = $this->article_obj
@@ -1380,7 +1448,7 @@ class Journal extends Controller {
->where('state', 0)
->where(function($query)use($arts, $data) {
$query->where('article_id', 'in', $arts)
- ->whereOr('title|abstract|keywords', 'like', '%' . str_replace("'","''",trim($data['keyword'])) . '%');
+ ->whereOr('title|abstract|keywords', 'like', '%' . str_replace("'", "''", trim($data['keyword'])) . '%');
})
->count();
@@ -1393,8 +1461,8 @@ class Journal extends Controller {
$list[$k]['stage'] = $stage_info;
//组合cite信息
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
- $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
- $cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
+ $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
+ $cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic', 'j_journal_topic.journal_topic_id = j_article_to_topic.topic_id', 'left')->where('j_article_to_topic.article_id', $v['article_id'])->where('j_article_to_topic.state', 0)->select();
$list[$k]['topic'] = $cache_topic;
$list[$k]['cite'] = $cite;
@@ -1455,8 +1523,8 @@ class Journal extends Controller {
$list[$k]['journal'] = $journal_info;
//组合cite信息
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
- $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
- $cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
+ $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
+ $cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic', 'j_journal_topic.journal_topic_id = j_article_to_topic.topic_id', 'left')->where('j_article_to_topic.article_id', $v['article_id'])->where('j_article_to_topic.state', 0)->select();
$list[$k]['topic'] = $cache_topic;
$list[$k]['cite'] = $cite;
@@ -1474,7 +1542,7 @@ class Journal extends Controller {
$re['count'] = $count;
return jsonSuccess($re);
}
-
+
/**
* @title 编委国际化
* @description 编委国际化
@@ -1502,7 +1570,6 @@ class Journal extends Controller {
$re['country'] = $frag;
return jsonSuccess($re);
}
-
/**
* @title 查找文章精确查找
@@ -1590,7 +1657,7 @@ class Journal extends Controller {
$list[$k]['journal'] = $journal_info;
//组合cite信息
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
- $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
+ $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
$list[$k]['cite'] = $cite;
$list[$k]['authortitle'] = $this->getAuthor($v);
//斜体变红
@@ -1689,8 +1756,8 @@ class Journal extends Controller {
$list[$k]['journal'] = $journal_info;
//组合cite信息
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
- $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
- $cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
+ $cite = $v['abbr'] . '. ' . $v['title'] . '. ' . choiseJabbr($v['article_id'], $journal_info['jabbr']) . '. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
+ $cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic', 'j_journal_topic.journal_topic_id = j_article_to_topic.topic_id', 'left')->where('j_article_to_topic.article_id', $v['article_id'])->where('j_article_to_topic.state', 0)->select();
$list[$k]['topic'] = $cache_topic;
$list[$k]['cite'] = $cite;
diff --git a/application/api/controller/Main.php b/application/api/controller/Main.php
index 820b536..7f4d2af 100644
--- a/application/api/controller/Main.php
+++ b/application/api/controller/Main.php
@@ -54,6 +54,11 @@ class Main extends Controller {
// return jsonSuccess(['aa'=>'wjl']);
echo md5("S123456pnx");
}
+
+
+ public function mddd(){
+ echo md5("zhu18920435065");
+ }
/**
* @title 获取scients
@@ -188,6 +193,17 @@ class Main extends Controller {
}
$list[$k]['title'] = $cache_title;
}
+
+ //连续出版判断,决定是否显示出版时间
+ foreach ($list as $k => $v){
+ $ca_stage = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find();
+ if(($v['journal_id']==2&&$ca_stage['stage_year']>=2022)||($v['journal_id']==18&&$ca_stage['stage_year']>=2022)||($v['journal_id']==17&&$ca_stage['stage_year']>=2019)){
+ $list[$k]['isShowOtime'] = 1;
+ }else{
+ $list[$k]['isShowOtime'] = 0;
+ }
+ }
+
// foreach ($list as $k => $v) {
// $list[$k]['authortitle'] = $this->getAuthor($v);
// }
@@ -281,6 +297,15 @@ class Main extends Controller {
}
$list[$k]['title'] = $cache_title;
}
+ //连续出版判断,决定是否显示出版时间
+ foreach ($list as $k => $v){
+ $ca_stage = $this->journal_stage_obj->where('journal_stage_id',$v['journal_stage_id'])->find();
+ if(($v['journal_id']==2&&$ca_stage['stage_year']>=2022)||($v['journal_id']==18&&$ca_stage['stage_year']>=2022)||($v['journal_id']==17&&$ca_stage['stage_year']>=2019)){
+ $list[$k]['isShowOtime'] = 1;
+ }else{
+ $list[$k]['isShowOtime'] = 0;
+ }
+ }
$re['articles'] = $list;
return jsonSuccess($re);
}
@@ -361,7 +386,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','specialIcon','system','articleCDF'];
+ $list = ['articleCite','articlePDF','articleicon','articleSUB','boardIcon','articleSUB2','baseTopic','journalCfp','journalfooter','journalicon','journalline','rotation','journaltopic','specialIcon','system','articleCDF'];
foreach ($list as $v){
$dir = $root_url."public/".$v."/".date('Ymd');
diff --git a/application/master/controller/Journal.php b/application/master/controller/Journal.php
index 56f3511..d84cebf 100644
--- a/application/master/controller/Journal.php
+++ b/application/master/controller/Journal.php
@@ -148,6 +148,7 @@ class Journal extends Controller {
$insert_data['editor_id'] = $data['editor_id'];
$insert_data['system_color'] = $data['system_color'];
$insert_data['submission_url'] = $data['submission_url'];
+ $insert_data['board_url'] = $data['board_url'];
$res = $this->journal_obj->insert($insert_data);
if($res){
return json(['code'=>0,'msg'=>'success']);
@@ -225,6 +226,7 @@ class Journal extends Controller {
$insert_data['editor_id'] = $data['editor_id'];
$insert_data['system_color'] = $data['system_color'];
$insert_data['submission_url'] = $data['submission_url'];
+ $insert_data['board_url'] = $data['board_url'];
$res = $this->journal_obj->where('journal_id',$data['journal_id'])->update($insert_data);
// if($res){
return json(['code'=>0,'msg'=>'success']);
@@ -378,6 +380,8 @@ class Journal extends Controller {
* @param name:website type:string require:1 desc:个人主页地址
* @param name:dr type:string require:1 desc:学位
* @param name:title type:string require:1 desc:职称
+ * @param name:field type:string require:1 desc:领域描述
+ * @param name:board_icon type:string require:1 desc:编委头像地址
* @param name:address type:string require:1 desc:单位
* @param name:country type:string require:1 desc:国家
* @param name:board_group_id type:int require:1 desc:编委分组id
@@ -386,12 +390,14 @@ class Journal extends Controller {
$data = $this->request->post();
$insert['journal_id'] = $data['journal_id'];
$insert['type'] = $data['type'];
- $insert['name'] = $data['name'];
- $insert['website'] = $data['website'];
+ $insert['name'] = trim($data['name']);
+ $insert['website'] = trim($data['website']);
$insert['dr'] = $data['dr'];
+ $insert['field'] = trim($data['field']);
$insert['title'] = $data['title'];
- $insert['address'] = $data['address'];
- $insert['country'] = $data['country'];
+ $insert['address'] = trim($data['address']);
+ $insert['country'] = trim($data['country']);
+ $insert['board_icon'] = trim($data['board_icon']);
$insert['board_group_id'] = $data['board_group_id'];
$this->board_obj->insert($insert);
return jsonSuccess([]);
@@ -425,18 +431,22 @@ class Journal extends Controller {
* @param name:website type:string require:1 desc:个人主页地址
* @param name:dr type:string require:1 desc:学位
* @param name:title type:string require:1 desc:职称
+ * @param name:field type:string require:1 desc:领域描述
* @param name:address type:string require:1 desc:单位
+ * @param name:board_icon type:string require:1 desc:编委头像
* @param name:country type:string require:1 desc:国家
* @param name:board_group_id type:int require:1 desc:编委分组id
*/
public function editBoard(){
$data = $this->request->post();
$insert['type'] = $data['type'];
- $insert['name'] = $data['name'];
- $insert['website'] = $data['website'];
+ $insert['name'] = trim($data['name']);
+ $insert['website'] = trim($data['website']);
$insert['dr'] = $data['dr'];
- $insert['title'] = $data['title'];
- $insert['address'] = $data['address'];
+ $insert['title'] = trim($data['title']);
+ $insert['field'] = trim($data['field']);
+ $insert['address'] = trim($data['address']);
+ $insert['board_icon'] = trim($data['board_icon']);
$insert['country'] = $data['country'];
$insert['board_group_id'] = $data['board_group_id'];
@@ -930,6 +940,30 @@ class Journal extends Controller {
}
}
+
+ /**
+ * @title 编委头像上传
+ * @description 编委头像上传
+ * @author wangjinlei
+ * @url /master/Journal/up_board_file
+ * @method POST
+ *
+ * @param name:name type:string require:1 default:boardIcon desc:文件域名称
+ *
+ * @return upurl:图片地址
+ */
+ public function up_board_file() {
+ $file = request()->file('boardIcon');
+ if ($file) {
+ $info = $file->move(ROOT_PATH . 'public' . DS . 'boardIcon');
+ if ($info) {
+ return json(['code'=>0 , 'msg'=>'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
+ } else {
+ return json(['code' => 1, 'msg' => $file->getError()]);
+ }
+ }
+ }
+
/**
* @title line图片上传
* @description line图片上传