1
This commit is contained in:
@@ -89,13 +89,13 @@ class Article extends Controller {
|
||||
$cite = $article_info['abbr'] . '. ' . $article_info['title'] . '. <i>' . choiseJabbr($article_info['article_id'], $journal_info['jabbr']) . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $article_info['npp'] . '. doi:' . $article_info['doi'];
|
||||
}
|
||||
|
||||
//获取html
|
||||
if($article_info['file_html']==''){
|
||||
$caches = $this->article_main_obj->where('article_id',$article_info['article_id'])->where('state',0)->select();
|
||||
if($caches){
|
||||
$article_info['file_html'] = $caches;
|
||||
}
|
||||
}
|
||||
// //获取html
|
||||
// if($article_info['file_html']==''){
|
||||
// $caches = $this->article_main_obj->where('article_id',$article_info['article_id'])->where('state',0)->select();
|
||||
// if($caches){
|
||||
// $article_info['file_html'] = $caches;
|
||||
// }
|
||||
// }
|
||||
|
||||
if (stripos($article_info['npp'], '-')) {
|
||||
$cc = explode('-', $article_info['npp']);
|
||||
@@ -153,6 +153,7 @@ class Article extends Controller {
|
||||
$re['stageInfo'] = $stage_info;
|
||||
$re['author'] = $author;
|
||||
$re['cite'] = $cite;
|
||||
$re['mains'] = getArticleMains($data['article_id']);
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
@@ -160,6 +161,7 @@ class Article extends Controller {
|
||||
echo 'ok';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 获取文章话题
|
||||
* @description 获取文章话题
|
||||
@@ -314,6 +316,8 @@ class Article extends Controller {
|
||||
$list[$k]['topic'] = $cache_topic;
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
|
||||
$list[$k]['mains'] = getArticleMains($v['article_id']);
|
||||
}
|
||||
//标题斜体
|
||||
foreach ($list as $k => $v) {
|
||||
@@ -395,6 +399,8 @@ class Article extends Controller {
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['journal_title'] = choiseti1($v['article_id'],$journal_info['title']);
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
|
||||
$list[$k]['mains'] = getArticleMains($v['article_id']);
|
||||
}
|
||||
//标题斜体
|
||||
foreach ($list as $k => $v) {
|
||||
|
||||
@@ -632,6 +632,7 @@ class Journal extends Controller {
|
||||
$cache_title = str_replace($val, '<i>' . $val . '</i>', $cache_title);
|
||||
}
|
||||
$list[$k]['title'] = $cache_title;
|
||||
$list[$k]['mains'] = getArticleMains($v['article_id']);
|
||||
}
|
||||
|
||||
//获取作者
|
||||
@@ -772,6 +773,7 @@ class Journal extends Controller {
|
||||
$cache_title = str_replace($val, '<i>' . $val . '</i>', $cache_title);
|
||||
}
|
||||
$list[$k]['title'] = $cache_title;
|
||||
$list[$k]['mains'] = getArticleMains($v['article_id']);
|
||||
}
|
||||
|
||||
//获取作者
|
||||
@@ -834,6 +836,8 @@ class Journal extends Controller {
|
||||
$list[$k]['topic'] = $cache_topic;
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
|
||||
$list[$k]['mains'] = getArticleMains($v['article_id']);
|
||||
}
|
||||
//标题斜体
|
||||
foreach ($list as $k => $v) {
|
||||
@@ -909,6 +913,8 @@ class Journal extends Controller {
|
||||
$list[$k]['topic'] = $cache_topic;
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
|
||||
$list[$k]['mains'] = getArticleMains($v['article_id']);
|
||||
}
|
||||
//连续出版判断,决定是否显示出版时间
|
||||
foreach ($list as $k => $v){
|
||||
@@ -1567,6 +1573,7 @@ class Journal extends Controller {
|
||||
}
|
||||
$cache_title = str_replace(trim($data['keyword']), '<b style="color:#c00">' . $data['keyword'] . '</b>', $cache_title);
|
||||
$list[$k]['title'] = $cache_title;
|
||||
$list[$k]['mains'] = getArticleMains($v['article_id']);
|
||||
}
|
||||
$re['articles'] = $list;
|
||||
$re['count'] = $count;
|
||||
|
||||
@@ -192,6 +192,8 @@ class Main extends Controller {
|
||||
$cache_title = str_replace($val, '<i>' . $val . '</i>', $cache_title);
|
||||
}
|
||||
$list[$k]['title'] = $cache_title;
|
||||
|
||||
$list[$k]['mains'] = getArticleMains($v['article_id']);
|
||||
}
|
||||
|
||||
//连续出版判断,决定是否显示出版时间
|
||||
@@ -251,6 +253,8 @@ class Main extends Controller {
|
||||
$cache_title = str_replace($val, '<i>' . $val . '</i>', $cache_title);
|
||||
}
|
||||
$list[$k]['title'] = $cache_title;
|
||||
|
||||
$list[$k]['mains'] = getArticleMains($v['article_id']);
|
||||
}
|
||||
|
||||
|
||||
@@ -298,6 +302,8 @@ class Main extends Controller {
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
|
||||
$list[$k]['mains'] = getArticleMains($v['article_id']);
|
||||
}
|
||||
|
||||
//标题斜体
|
||||
@@ -375,6 +381,8 @@ class Main extends Controller {
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
|
||||
$list[$k]['mains'] = getArticleMains($v['article_id']);
|
||||
}
|
||||
|
||||
//标题斜体
|
||||
|
||||
@@ -350,6 +350,8 @@ class Special extends Controller {
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . choiseJabbr($v['article_id'],$journal_info['jabbr']) . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
|
||||
$list[$k]['mains'] = getArticleMains($v['article_id']);
|
||||
}
|
||||
$re['articles'] = $list;
|
||||
return jsonSuccess($re);
|
||||
|
||||
@@ -85,6 +85,8 @@ class Tmrde extends Controller{
|
||||
$cache_title = str_replace($val, '<i>' . $val . '</i>', $cache_title);
|
||||
}
|
||||
$list[$k]['title'] = $cache_title;
|
||||
|
||||
$list[$k]['mains'] = getArticleMains($v['article_id']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -74,6 +74,26 @@ function choiseJabbr($article_id,$jabbr){
|
||||
return $jabbr;
|
||||
}
|
||||
|
||||
function getArticleMains($article_id){
|
||||
$article_main_obj = Db::name("article_main");
|
||||
$list = $article_main_obj->where('article_id',$article_id)->where('state',0)->where('is_add',0)->select();
|
||||
$frag = [];
|
||||
foreach ($list as $v){
|
||||
$frag[] = $v;
|
||||
$pre = $v['article_main_id'];
|
||||
while ($pre!=0){
|
||||
$ca = $article_main_obj->where("pre_id",$pre)->where('state',0)->find();
|
||||
if($ca){
|
||||
$frag[] = $ca;
|
||||
$pre = $ca['article_main_id'];
|
||||
}else{
|
||||
$pre = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $frag;
|
||||
}
|
||||
|
||||
function choiseJtitle($list){
|
||||
foreach ($list as $k => $v){
|
||||
$list[$k]['journal_title'] = choiseti($v);
|
||||
|
||||
@@ -545,7 +545,7 @@ class Article extends Controller
|
||||
Db::commit();
|
||||
$this->pushDoiToCrossref($data['doi'], $aid);
|
||||
$this->pushEmailToAuthor($aid);
|
||||
$this->addArticleMain($aid,$data['p_article_id']);
|
||||
// $this->addArticleMain($aid,$data['p_article_id']);
|
||||
return jsonSuccess(['article_id' => $aid]);
|
||||
} else {
|
||||
Db::rollback();
|
||||
@@ -1100,7 +1100,7 @@ class Article extends Controller
|
||||
$article_list[$k]['med_title'] = '';
|
||||
$article_list[$k]['med_ename'] = '';
|
||||
}
|
||||
$article_list[$k]['mains'] = $this->article_main_obj->where('article_id',$v['article_id'])->where('state',0)->select();
|
||||
$article_list[$k]['mains'] = getArticleMains($v['article_id']);
|
||||
}
|
||||
$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']))
|
||||
@@ -1108,6 +1108,100 @@ class Article extends Controller
|
||||
return json(['code' => 0, 'msg' => 'success', 'data' => ['count' => $count, 'articleList' => $article_list]]);
|
||||
}
|
||||
|
||||
|
||||
public function getArticleMainsForSubmission(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"article_id"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
|
||||
$mains = getArticleMains($data['article_id']);
|
||||
$re['article'] = $article_info;
|
||||
$re['mains'] = $mains;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
public function delArticleMainForSubmission(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"article_main_id"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$main_info = $this->article_main_obj->where('article_main_id',$data['article_main_id'])->find();
|
||||
$next = $this->article_main_obj->where('pre_id',$data['article_main_id'])->where('state',0)->find();
|
||||
if($next){
|
||||
//找到目标删除点的上位节点
|
||||
$pre = $this->article_main_obj
|
||||
->where('article_main_id','<',$main_info['article_main_id']-1)
|
||||
->order("article_main_id desc")
|
||||
->limit(1)->select();
|
||||
$pre_id = $pre[0]['article_main_id'];
|
||||
$find_add = true;
|
||||
while ($find_add){
|
||||
$fi = $this->article_main_obj->where('pre_id',$pre_id)->where('state',0)->find();
|
||||
if($fi){
|
||||
$pre_id = $fi['article_main_id'];
|
||||
}else{
|
||||
$find_add = false;
|
||||
}
|
||||
}
|
||||
$this->article_main_obj->where('article_main_id',$next['article_main_id'])->update(['pre_id'=>$pre_id]);
|
||||
}
|
||||
$this->article_main_obj->where('article_main_id',$data['article_main_id'])->update(['state'=>1]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
public function editArticleMainForSubmission(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"article_main_id"=>"require",
|
||||
"type"=>"require",
|
||||
"content"=>"require",
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
if($data['type']=="img"){
|
||||
$update['content'] = $data['content'];
|
||||
$update['width'] = $data['width'];
|
||||
$update['note'] = $data['note'];
|
||||
}else{
|
||||
$update['content'] = trim($data['content']);
|
||||
}
|
||||
$this->article_main_obj->where('article_main_id',$data['article_main_id'])->update($update);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
public function addArticleMainAddForSubmission(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"article_id"=>'require',
|
||||
"pre_id"=>"require",
|
||||
"type"=>"require",
|
||||
"content"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$insert['article_id'] = $data['article_id'];
|
||||
$insert['pre_id'] = $data['pre_id'];
|
||||
$insert['is_add'] = 1;
|
||||
$insert['content'] = trim($data['content']);
|
||||
if($data['type']=="img"){
|
||||
$insert['width'] = $data['width'];
|
||||
$insert['note'] = trim($data['note']);
|
||||
}
|
||||
$this->article_main_obj->insert($insert);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取文章对应期刊话题
|
||||
* @description 获取文章对应期刊话题
|
||||
|
||||
@@ -167,32 +167,5 @@ class Submision extends Controller {
|
||||
return $frag;
|
||||
}
|
||||
|
||||
public function getArticleMains(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"article_id"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$mains = $this->article_main_obj->where('article_id',$data['article_id'])->where('state',0)->select();
|
||||
$re['mains'] = $mains;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
public function delArticleMain(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"article_main_id"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$this->article_main_obj->where('article_main_id',$data['article_main_id'])->update(['state'=>1]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user