Files
journal/application/master/controller/Article.php
wangjinlei f2fcabbaa5 1
2023-06-09 08:59:33 +08:00

2313 lines
127 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace app\master\controller;
use Exception;
use think\Controller;
use think\Db;
use think\Queue;
use think\Validate;
/**
* @title 文章接口
* @description 文章相关操作
* @group 文章相关
*/
class Article extends Controller
{
//put your code here
protected $admin_obj = '';
protected $journal_obj = '';
protected $article_obj = '';
protected $article_author_obj = '';
protected $article_organ_obj = '';
protected $article_ltai_obj = '';
protected $article_cite_obj = '';
protected $author_to_organ_obj = '';
protected $article_to_topic_obj = '';
protected $journal_topic_obj = '';
protected $journal_stage_obj = '';
protected $journal_special_obj = '';
protected $country_obj = '';
protected $subscribe_journal_obj = '';
protected $subscribe_topic_obj = '';
protected $base_topic_obj = '';
protected $subscribe_base_topic_obj = '';
protected $medicament_obj = '';
protected $article_to_medicament_obj = '';
protected $article_main_obj = '';
public function __construct(\think\Request $request = null)
{
parent::__construct($request);
$this->admin_obj = Db::name('admin');
$this->journal_obj = Db::name('journal');
$this->article_obj = Db::name('article');
$this->article_author_obj = Db::name('article_author');
$this->article_organ_obj = Db::name('article_organ');
$this->article_ltai_obj = Db::name('article_ltai');
$this->article_cite_obj = Db::name('article_cite');
$this->author_to_organ_obj = Db::name('article_author_to_organ');
$this->article_to_topic_obj = Db::name('article_to_topic');
$this->journal_topic_obj = Db::name('journal_topic');
$this->journal_stage_obj = Db::name('journal_stage');
$this->journal_special_obj = Db::name('journal_special');
$this->country_obj = Db::name('country');
$this->subscribe_journal_obj = Db::name('subscribe_journal');
$this->subscribe_topic_obj = Db::name('subscribe_topic');
$this->base_topic_obj = Db::name('base_topic');
$this->subscribe_base_topic_obj = Db::name('subscribe_base_topic');
$this->medicament_obj = Db::name('medicament');
$this->article_to_medicament_obj = Db::name('ArticleToMedicament');
$this->article_main_obj = Db::name("article_main");
}
/**
* @title 获取期刊和分期
* @description 获取期刊和分期
* @param name:editor_id type:int require:1 desc:编辑id
*
* @return joutaglist:array#
*
* @author wangjinleichang
* @url /master/Article/getJournalAndStage
* @method POST
*
*/
public function getJournalAndStage()
{
$data = $this->request->post();
$journal_list = $this->journal_obj->where('editor_id', $data['editor_id'])->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 添加文章基本信息
* @description 添加文章基本信息
* @param name:journal_id type:int require:1 desc:期刊id
* @param name:journal_stage_id type:int require:1 desc:分期id
* @param name:sort type:int require:1 default:0 desc:权重
* @param name:title type:string require:1 desc:标题
* @author wangjinleichang
* @url /master/Article/addArticleBase
* @method POST
*
*/
public function addArticleBase()
{
$data = $this->request->post();
$insert_data['journal_id'] = $data['journal_id'];
$insert_data['journal_stage_id'] = $data['journal_stage_id'];
$insert_data['title'] = $data['title'];
$insert_data['sort'] = $data['sort'];
$insert_data['ctime'] = time();
$res = $this->article_obj->insert($insert_data);
if ($res) {
return json(['code' => 0, 'msg' => 'success']);
} else {
return json(['code' => 1, 'msg' => 'system error']);
}
}
/**
* @title 删除文章
* @description 删除文章
* @param name:article_id type:int require:1 desc:文章id
* @author wangjinleichang
* @url /master/Article/delArticle
* @method POST
*
*/
public function delArticle()
{
$data = $this->request->post();
$res = $this->article_obj->where('article_id', $data['article_id'])->update(['state' => 1]);
return json(['code' => 0, 'msg' => 'success']);
}
/**
* @title 添加文章作者
* @description 添加文章作者
* @param name:article_id type:int require:1 desc:article_id
* @param name:author_name type:string require:1 desc:作者名字
* @param name:author_country type:string require:1 desc:国家
* @param name:orcid type:string require:0 desc:orcid
* @param name:is_first type:boolean require:1 default:0 desc:是否第一作者(1yes0no)
* @param name:is_report type:boolean require:1 default:0 desc:是否通讯作者(1yes0no)
* @param name:email type:string require:0 desc:邮箱
* @param name:organs type:string require:1 desc:array
*
* @author wangjinleichang
* @url /master/Article/addArticleAuthor
* @method POST
*
*/
public function addArticleAuthor()
{
$data = $this->request->post();
$insert_author['article_id'] = $data['article_id'];
$insert_author['author_name'] = trim($data['author_name']);
//处理名字
$ca = explode(' ', $insert_author['author_name']);
$caf = '';
$cal = '';
if (isset($ca[0])) {
$caf = str_replace('-', '', $ca[0]);
}
if (isset($ca[1])) {
$cal = $ca[1];
}
$insert_author['first_name'] = $caf;
$insert_author['last_name'] = $cal;
$insert_author['orcid'] = isset($data['orcid']) ? $data['orcid'] : '';
$insert_author['author_country'] = $data['author_country'];
$insert_author['is_first'] = $data['is_first'];
$insert_author['is_report'] = $data['is_report'];
$insert_author['email'] = intval($data['is_report']) == 1 ? $data['email'] : '';
Db::startTrans();
$insert_id = $this->article_author_obj->insertGetId($insert_author);
$or_res = true;
if (isset($data['organs']) && is_array($data['organs'])) {
foreach ($data['organs'] as $k => $v) {
$cache_ins['article_id'] = $data['article_id'];
$cache_ins['article_author_id'] = $insert_id;
$cache_ins['article_organ_id'] = $v;
$or_res = $this->author_to_organ_obj->insert($cache_ins) ? true : false;
}
}
if ($insert_id && $or_res) {
Db::commit();
return json(['code' => 0, 'msg' => 'success']);
} else {
Db::rollback();
return json(['code' => 1, 'msg' => 'system error']);
}
}
/**
* @title 编辑文章作者
* @description 编辑文章作者
* @param name:article_author_id type:int require:1 desc:article_id
* @param name:author_name type:string require:1 desc:作者名字
* @param name:orcid type:string require:0 desc:orcid
* @param name:author_country type:string require:1 desc:国家
* @param name:is_first type:boolean require:1 default:0 desc:是否第一作者(1yes0no)
* @param name:is_report type:boolean require:1 default:0 desc:是否通讯作者(1yes0no)
* @param name:email type:string require:0 desc:邮箱
* @param name:organs type:string require:1 desc:array
*
* @author wangjinleichang
* @url /master/Article/editArticleAuthor
* @method POST
*
*/
public function editArticleAuthor()
{
$data = $this->request->post();
// $data['article_author_id'] = 21;
// $data['article_id'] = 38;
// $data['author_name'] = '作者3';
// $data['author_country'] = 'Netherlands';
// $data['is_first'] = 1;
// $data['is_report'] = 1;
// $data['email'] = 'xl37@163.com';
// $data['organs'] = ['1','2','3'];
$old_article_author_info = $this->article_author_obj->where('article_author_id', $data['article_author_id'])->find();
$update_author['author_name'] = trim($data['author_name']);
//处理名字
$ca = explode(' ', $update_author['author_name']);
$caf = '';
$cal = '';
if (isset($ca[0])) {
$caf = str_replace('-', '', $ca[0]);
}
if (isset($ca[1])) {
$cal = $ca[1];
}
$update_author['first_name'] = $caf;
$update_author['last_name'] = $cal;
$update_author['orcid'] = isset($data['orcid']) ? $data['orcid'] : '';
$update_author['author_country'] = $data['author_country'];
$update_author['is_first'] = $data['is_first'];
$update_author['is_report'] = $data['is_report'];
$update_author['email'] = intval($data['is_report']) == 1 ? $data['email'] : '';
$this->article_author_obj->where('article_author_id', $data['article_author_id'])->update($update_author);
if (is_array($data['organs'])) {
$has_ids = [];
foreach ($data['organs'] as $v) {
$cache_one = $this->author_to_organ_obj->where('article_author_id', $data['article_author_id'])->where('article_organ_id', $v)->where('state', 0)->find();
if ($cache_one == null) {
$insert['article_id'] = $old_article_author_info['article_id'];
$insert['article_author_id'] = $data['article_author_id'];
$insert['article_organ_id'] = $v;
$this->author_to_organ_obj->insert($insert);
}
$has_ids[] = intval($v);
}
$this->author_to_organ_obj->where('article_author_id', $data['article_author_id'])->where('state', 0)->where('article_organ_id', 'not in', $has_ids)->update(['state' => 1]);
} else {
$this->author_to_organ_obj->where('article_author_id', $data['article_author_id'])->where('state', 0)->update(['state' => 1]);
}
return json(['code' => 0, 'msg' => 'success']);
}
/**
* @title 删除文章作者
* @description 删除文章作者
* @param name:article_author_id type:int require:1 desc:article_id
*
* @author wangjinleichang
* @url /master/Article/delArticleAuthor
* @method POST
*
*/
public function delArticleAuthor()
{
$data = $this->request->post();
//删除作者和机构的关系
$this->author_to_organ_obj->where('article_author_id', $data['article_author_id'])->update(['state' => 1]);
$this->article_author_obj->where('article_author_id', $data['article_author_id'])->update(['state' => 1]);
return json(['code' => 0, 'msg' => 'success']);
}
/**
* @title 获取文章作者和机构
* @description 获取文章作者和机构
* @param name:article_id type:int require:1 desc:article_id
*
* @return authorList:array#
* @return organList:array#
* @author wangjinleichang
* @url /master/Article/getArticleAuthor
* @method POST
*
*/
public function getArticleAuthor()
{
$data = $this->request->post();
$author_list = $this->article_author_obj->where('article_id', $data['article_id'])->where('state', 0)->select();
foreach ($author_list as $k => $v) {
$cache_to = $this->author_to_organ_obj
->field('j_article_author_to_organ.*,j_article_organ.organ_name')
->join('j_article_organ', 'j_article_organ.article_organ_id = j_article_author_to_organ.article_organ_id')
->where('j_article_author_to_organ.article_author_id', $v['article_author_id'])
->where('j_article_author_to_organ.state', 0)
->select();
$cache_frag = [];
foreach ($cache_to as $vv) {
$cache_frag[] = $vv;
}
$author_list[$k]['organs'] = $cache_frag;
}
$organ_list = $this->article_organ_obj->where('article_id', $data['article_id'])->where('state', 0)->select();
return json(['code' => 0, 'msg' => 'success', 'data' => ['authorList' => $author_list, 'organList' => $organ_list]]);
}
/**
* @title 添加文章作者机构
* @description 添加文章作者机构
* @param name:article_id type:int require:1 desc:article_id
* @param name:organ_name type:string require:1 desc:机构名字
* @author wangjinleichang
* @url /master/Article/addArticleOrgan
* @method POST
*
*/
public function addArticleOrgan()
{
$data = $this->request->post();
$insert_data['article_id'] = $data['article_id'];
$insert_data['organ_name'] = $data['organ_name'];
$res = $this->article_organ_obj->insert($insert_data);
if ($res) {
return json(['code' => 0, 'msg' => 'success']);
} else {
return json(['code' => 1, 'msg' => 'system error']);
}
}
/**
* @title 编辑文章作者机构
* @description 编辑文章作者机构
* @param name:article_organ_id type:int require:1 desc:article_organ_id
* @param name:organ_name type:string require:1 desc:机构名字
* @author wangjinleichang
* @url /master/Article/editArticleOrgan
* @method POST
*
*/
public function editArticleOrgan()
{
$data = $this->request->post();
$this->article_organ_obj->where('article_organ_id', $data['article_organ_id'])->update(['organ_name' => $data['organ_name']]);
return json(['code' => 0, 'msg' => 'success']);
}
/**
* @title 删除文章作者机构
* @description 删除文章作者机构
* @param name:article_organ_id type:int require:1 desc:article_organ_id
* @author wangjinleichang
* @url /master/Article/delArticleOrgan
* @method POST
*
*/
public function delArticleOrgan()
{
$data = $this->request->post();
//删除作者和机构的关系
$this->author_to_organ_obj->where('article_organ_id', $data['article_organ_id'])->update(['state' => 1]);
$this->article_organ_obj->where('article_organ_id', $data['article_organ_id'])->update(['state' => 1]);
return json(['code' => 0, 'msg' => 'success']);
}
/**
* 添加文章通过投稿系统
*/
public function addArticleForSubmission()
{
$data = $this->request->post();
$rule = new Validate([
'title' => 'require',
'journal_stage_id' => 'require',
'issn' => 'require',
'type' => 'require',
'abbr' => 'require',
'doi' => 'require',
'abstract' => 'require',
'file_pdf' => 'require',
'pub_date' => 'require',
'keywords' => 'require',
'npp' => 'require'
]);
if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$journal_info = $this->journal_obj->where('issn', $data['issn'])->find();
if (!is_dir(ROOT_PATH . 'public' . DS . 'articlePDF' . DS . date('Ymd'))) {
mkdir(ROOT_PATH . 'public' . DS . 'articlePDF' . DS . date('Ymd'));
}
$file_name = substr($data['file_pdf'], strripos($data['file_pdf'], '/') + 1);
$co = @copy("http://api.tmrjournals.com/public/" . $data['file_pdf'], ROOT_PATH . 'public' . DS . 'articlePDF' . DS . date('Ymd') . DS . $file_name);
if ($co != 1) {
return jsonError('copy error!');
}
//处理基本信息
$insert['title'] = trim($data['title']);
$insert['journal_id'] = $journal_info['journal_id'];
$insert['journal_stage_id'] = $data['journal_stage_id'];
$insert['type'] = $data['type'];
if (isset($data['icon']) && $data['icon'] != '') {
$cfile_name = substr($data['icon'], strripos($data['icon'], '/') + 1);
if (!is_dir(ROOT_PATH . 'public' . DS . 'articleicon' . DS . date('Ymd'))) {
mkdir(ROOT_PATH . 'public' . DS . 'articleicon' . DS . date('Ymd'));
}
$co = @copy("http://api.tmrjournals.com/public/articleicon/" . $data['icon'], ROOT_PATH . 'public' . DS . 'articleicon' . DS . date('Ymd') . DS . $cfile_name);
$insert['icon'] = date('Ymd') . DS . $cfile_name;
}
if (isset($data['file_sub']) && $data['file_sub'] != '') {
$cfile_name = substr($data['file_sub'], strripos($data['file_sub'], '/') + 1);
if (!is_dir(ROOT_PATH . 'public' . DS . 'articleSUB' . DS . date('Ymd'))) {
mkdir(ROOT_PATH . 'public' . DS . 'articleSUB' . DS . date('Ymd'));
}
$co = @copy("http://api.tmrjournals.com/public/articleSUB/" . $data['file_sub'], ROOT_PATH . 'public' . DS . 'articleSUB' . DS . date('Ymd') . DS . $cfile_name);
$insert['file_sub'] = date('Ymd') . DS . $cfile_name;
}
if (isset($data['file_sub2']) && $data['file_sub2'] != '') {
$cfile_name = substr($data['file_sub2'], strripos($data['file_sub2'], '/') + 1);
if (!is_dir(ROOT_PATH . 'public' . DS . 'articleSUB2' . DS . date('Ymd'))) {
mkdir(ROOT_PATH . 'public' . DS . 'articleSUB2' . DS . date('Ymd'));
}
$co = @copy("http://api.tmrjournals.com/public/articleSUB2/" . $data['file_sub2'], ROOT_PATH . 'public' . DS . 'articleSUB2' . DS . date('Ymd') . DS . $cfile_name);
$insert['file_sub2'] = date('Ymd') . DS . $cfile_name;
}
if (isset($data['file_cdf']) && $data['file_cdf'] != '') {
$cfile_name = substr($data['file_cdf'], strripos($data['file_cdf'], '/') + 1);
if (!is_dir(ROOT_PATH . 'public' . DS . 'articleCDF' . DS . date('Ymd'))) {
mkdir(ROOT_PATH . 'public' . DS . 'articleCDF' . DS . date('Ymd'));
}
$co = @copy("http://api.tmrjournals.com/public/articleCDF/" . $data['file_cdf'], ROOT_PATH . 'public' . DS . 'articleCDF' . DS . date('Ymd') . DS . $cfile_name);
$insert['file_cdf'] = date('Ymd') . DS . $cfile_name;
}
if (isset($data['endnote']) && $data['endnote'] != '') {
$cfile_name = substr($data['endnote'], strripos($data['endnote'], '/') + 1);
if (!is_dir(ROOT_PATH . 'public' . DS . 'endNote' . DS . date('Ymd'))) {
mkdir(ROOT_PATH . 'public' . DS . 'endNote' . DS . date('Ymd'));
}
$co = @copy("http://api.tmrjournals.com/public/endNote/" . $data['endnote'], ROOT_PATH . 'public' . DS . 'endNote' . DS . date('Ymd') . DS . $cfile_name);
$insert['endnote'] = date('Ymd') . DS . $cfile_name;
}
if (isset($data['bibtex']) && $data['bibtex'] != '') {
$cfile_name = substr($data['bibtex'], strripos($data['bibtex'], '/') + 1);
if (!is_dir(ROOT_PATH . 'public' . DS . 'bibTex' . DS . date('Ymd'))) {
mkdir(ROOT_PATH . 'public' . DS . 'bibTex' . DS . date('Ymd'));
}
$co = @copy("http://api.tmrjournals.com/public/bibTex/" . $data['bibtex'], ROOT_PATH . 'public' . DS . 'bibTex' . DS . date('Ymd') . DS . $cfile_name);
$insert['bibtex'] = date('Ymd') . DS . $cfile_name;
}
$insert['doi'] = '10.53388/' . $data['doi'];
$insert['abstract'] = $data['abstract'];
$insert['pub_date'] = $data['pub_date'];
$insert['abbr'] = $data['abbr'];
$insert['tradition_tag'] = isset($data['tradition_tag']) ? $data['tradition_tag'] : '';
$insert['tradition'] = isset($data['tradition']) ? $data['tradition'] : '';
$insert['keywords'] = $data['keywords'];
$insert['npp'] = $data['npp'];
$sort = 0;
if ($journal_info['journal_id'] == 2 || $journal_info['journal_id'] == 17 || $journal_info['journal_id'] == 18) {
$sort = intval(substr($data['npp'], -2));
} else {
$sort = $data['npp'];
}
$insert['sort'] = $sort;
$insert['file_pdf'] = date('Ymd') . DS . $file_name;
$insert['mhoo'] = $data['mhoo'];
$insert['is_public'] = 1;
$insert['ctime'] = time();
Db::startTrans();
$aid = $this->article_obj->insertGetId($insert);
//处理斜体
$ltai_res = true;
if (isset($data['ltai']) && $data['ltai'] != '') {
$ltai = explode(',', $data['ltai']);
$ltai_input = [];
foreach ($ltai as $v) {
$cache_input['article_id'] = $aid;
$cache_input['content'] = $v;
$ltai_input[] = $cache_input;
}
$ltai_res = $this->article_ltai_obj->insertAll($ltai_input);
}
//处理作者
try {
$authors = object_to_array(json_decode($data['authors']));
$organs = object_to_array(json_decode($data['organs']));
$organ_res = true;
foreach ($organs as $v) {
$ca_insert['article_id'] = $aid;
$ca_insert['organ_name'] = $v['organ_name'];
$organ_res = $this->article_organ_obj->insert($ca_insert);
}
$author_res = true;
$ato_res = true;
$ca_au_id = true;
foreach ($authors as $v) {
$insert_author['article_id'] = $aid;
$insert_author['author_name'] = $journal_info['journal_id'] == 22 ? $v['last_name'] . $v['first_name'] : $v['first_name'] . ' ' . $v['last_name'];
$insert_author['first_name'] = $v['first_name'];
$insert_author['last_name'] = $v['last_name'];
$insert_author['author_country'] = $v['author_country'];
$insert_author['is_first'] = $v['is_first'];
$insert_author['is_report'] = $v['is_report'];
$insert_author['orcid'] = $v['orcid'];
$insert_author['email'] = $v['email'];
$ca_au_id = $this->article_author_obj->insertGetId($insert_author);
$cache_organs = $v['organs'];
foreach ($cache_organs as $val) {
$c_organ = $this->article_organ_obj->where('article_id', $aid)->where('organ_name', $val['organ_name'])->find();
if ($c_organ == null) {
return jsonError('organ error!');
}
$insert_orm['article_id'] = $aid;
$insert_orm['article_author_id'] = $ca_au_id;
$insert_orm['article_organ_id'] = $c_organ['article_organ_id'];
$ato_res = $this->author_to_organ_obj->insert($insert_orm);
}
}
} catch (Exception $e) {
Db::rollback();
return jsonError($e->getMessage());
}
if ($aid && $organ_res && $ltai_res && $author_res && $ato_res && $ca_au_id) {
Db::commit();
$this->pushDoiToCrossref($data['doi'], $aid);
$this->pushEmailToAuthor($aid);
// $this->addArticleMain($aid,$data['p_article_id']);
return jsonSuccess(['article_id' => $aid]);
} else {
Db::rollback();
return jsonError('system error');
}
}
public function addArticleMainForSubmission(){
$data = $this->request->post();
$rule = new Validate([
"article_id"=>"require",
"p_article_id"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$check = $this->article_main_obj->where('article_id',$data['article_id'])->where('state',0)->find();
if($check){
return jsonError("Repeated submission");
}
$this->addArticleMain($data['article_id'],$data['p_article_id']);
}
private function addArticleMain($now_id,$p_id){
$url = "http://api.tmrjournals.com/public/index.php/api/Production/getProductionMains";
$pra['p_article_id'] = $p_id;
$res = object_to_array(json_decode(myPost($url,$pra)));
$mains = $res['data']['mains'];
if(count($mains)==0){
return ;
}
foreach ($mains as $k => $v){
$insert['article_id'] = $now_id;
$insert['width'] = isset($v['width'])?$v['width']:0;
$insert['content'] = $v['content'];
$insert['note'] = isset($v['note'])?$v['note']:'';
$this->article_main_obj->insert($insert);
}
}
private function pushDoiToCrossref($doi, $article_id)
{
$url = 'https://doi.crossref.org/servlet/deposit';
$file = ROOT_PATH . 'public' . DS . 'xml' . DS . $article_id . '.xml';
$d['doi_num'] = $doi;
$d['article_id'] = $article_id;
$this->crossRef($d);
//发送请求
$par['login_id'] = 'books@tmrjournals.com/tmrp';
$par['login_passwd'] = '849192806pnX';
$par['fname'] = new \CURLFile($file);
$res = $this->myPost($url, $par);
return $res;
}
// public function testp(){
// $this->pushEmailToAuthor(2551);
// }
private function pushEmailToAuthor($article_id)
{
$article_info = $this->article_obj->where('article_id', $article_id)->find();
$journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find();
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $article_info['journal_stage_id'])->find();
$authors = $this->article_author_obj->where('article_id', $article_id)->where('state', 0)->select();
foreach ($authors as $v) {
if ($v['email'] == '') {
continue;
}
$tt = "Dear " . $v['author_name'] . ",<br/><br/>";
$tt .= "We are delighted to inform you that your article has been published online in " . $journal_info['title'] . ". Congratulations on this significant accomplishment! Your article can be found in Vol. " . $stage_info['stage_vol'] . " Issue " . $stage_info['stage_no'] . " <a href='https://www.tmrjournals.com/article.html?J_num=" . $journal_info['journal_id'] . "&a_id=" . $article_info['article_id'] . "'>article link</a>.<br/><br/>";
$tt .= "We appreciate your decision to choose <i>" . $journal_info['title'] . "</i> for publishing your research, and we hope that it has been a fulfilling experience for you. We believe that your work will be of great value to the scientific community and will contribute to the advancement of knowledge in your field.<br/><br/>";
$tt .= "To help your research reach a broader audience, we recommend utilizing the following channels: ResearchGate, Academia.edu, Twitter, LinkedIn, and Facebook. By sharing your work on these platforms, you can ensure that it receives the attention it deserves.<br/><br/>";
$tt .= "https://www.researchgate.net<br/>https://www.academia.edu<br/>https://twitter.com<br/>https://www.linkedin.com<br/>https://www.facebook.com<br/><br/>";
$tt .= "Once again, congratulations on your publication, and we look forward to receiving more manuscripts from you in the future.";
$maidata['email'] = $v['email'];
$maidata['title'] = $journal_info['title'] . "" . $article_info['title'];
$maidata['content'] = $tt;
$maidata['tmail'] = $journal_info['email'];
$maidata['tpassword'] = $journal_info['epassword'];
// dump($maidata);
Queue::push('app\api\job\mail@fire', $maidata, "mail");
}
}
/**
* 获取online文章列表
*/
public function getOnlineArticleForSubmit()
{
$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('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)->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 changeArticleForSubmit()
{
$data = $this->request->post();
$rule = new Validate([
'article_id' => 'require',
'sort' => 'require'
]);
if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$this->article_obj->where('article_id', $data['article_id'])->update(['sort' => $data['sort']]);
return jsonSuccess([]);
}
/**
* 更改文章客座
*/
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}]";
// $authors = object_to_array(json_decode($str));
// $o = [];
// $orgs = [];
// foreach($authors as $k => $v){
// if(in_array($v['company'],$orgs)){
// continue;
// }
// $orgs[] = $v['company'];
// }
// foreach($orgs as $v){
// $insert['article_id'] = 8888;
// $insert['organ_name'] = $v;
// $ca_id = $this->article_organ_obj->insertGetId($insert);
// $o[$v] = $ca_id;
// }
// foreach($authors as $v){
// $insert_author['article_id'] = 8888;
// $insert_author['author_name'] = $v['firstname'].' '.$v['lastname'];
// $insert_author['first_name'] = $v['firstname'];
// $insert_author['last_name'] = $v['lastname'];
// $insert_author['author_country'] = $v['country'];
// $insert_author['is_first'] = $v['is_super'];
// $insert_author['is_report'] = $v['is_report'];
// $insert_author['email'] = $v['email'];
// $ca_au_id = $this->article_author_obj->insertGetId($insert_author);
// $insert_orm['article_id'] = 8888;
// $insert_orm['article_author_id'] = $ca_au_id;
// $insert_orm['article_organ_id'] = $o[$v['company']];
// $this->author_to_organ_obj->insert($insert_orm);
// }
// echo 'ok';
// }
/**
* @title 获取文章基本信息
* @description 获取文章基本信息
* @param name:article_id type:int require:1 desc:文章id
*
* @return journal:期刊信息#
* @return articleInfo:文章详情@
* @articleInfo icon:图片
* @articleInfo tradition_tag:封皮标签
* @articleInfo tradition:封皮简介
* @articleInfo doi:doi
* @articleInfo abstract:简介
* @articleInfo keywords:关键字
* @articleInfo fund:fund
* @articleInfo file_html:html文件
* @articleInfo sort:权重
* @articleInfo pub_date:发表日期
*
* @return files:文件列表#
* @author wangjinleichang
* @url /master/Article/getArticleBase
* @method POST
*
*/
public function getArticleBase()
{
$data = $this->request->post();
$article_info = $this->article_obj->where('article_id', $data['article_id'])->find();
$ltais = $this->article_ltai_obj->where('article_id', $article_info['article_id'])->where('state', 0)->column('content');
$article_info['ltai'] = implode(',', $ltais);
$journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find();
$list = scandir(ROOT_PATH . 'public/articleHTML/' . trim($journal_info['sx']));
$frag = [];
foreach ($list as $k => $v) {
if ($k > 1) {
$frag[] = ['val' => $v];
}
}
$re['journal'] = $journal_info;
$re['articleInfo'] = $article_info;
$re['files'] = $frag;
return jsonSuccess($re);
// return json(['code'=>0,'msg'=>'success','data'=>$article_info]);
}
public function getHtmlFiles()
{
$data = $this->request->post();
$article_info = $this->article_obj->where('article_id', $data['article_id'])->find();
$journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find();
$list = scandir(ROOT_PATH . 'public/articleHTML/' . $journal_info['sx']);
$frag = [];
foreach ($list as $k => $v) {
if ($k > 1) {
$frag[] = $v;
}
}
return jsonSuccess($data);
// $list = scandir(ROOT_PATH.'public/articleHTML/TMR');
// echo '<pre>';
// var_dump($list);
// echo '</pre>';
// die;
}
/**
* @title 编辑文章基本信息
* @description 编辑文章基本信息
* @param name:article_id type:int require:1 desc:文章id
* @param name:title type:string require:1 desc:标题
* @param name:subtitle type:string require:0 desc:副标题
* @param name:rotation type:string require:0 desc:轮播图
* @param name:icon type:string require:1 desc:图片
* @param name:tradition_tag type:string require:1 desc:封皮标签
* @param name:tradition type:string require:1 desc:封皮简介
* @param name:mhoo type:string require:1 desc:Medical history of objective
* @param name:journal_stage_id type:int require:1 desc:期刊分期id
* @param name:journal_special_id type:int require:1 desc:客座期刊id
* @param name:doi type:string require:1 desc:doi
* @param name:abstract type:string require:1 desc:简介
* @param name:keywords type:string require:1 desc:关键字
* @param name:ltai type:string require:0 desc:标题斜体(demo1,demo2)
* @param name:npp type:strng require:1 desc:文章页码
* @param name:is_public type:int require:1 desc:0不显示1显示
* @param name:type type:string require:1 desc:类型
* @param name:cited type:int require:1 desc:引用数
* @param name:abbr type:string require:0 desc:作者简称
* @param name:sort type:int require:1 desc:权重
* @param name:other_state type:int require:1 desc:附加状态0默认1Being questioned被质疑2Withdrawal被撤回
* @param name:file_html type:string require:0 desc:html文件
* @param name:fund type:string require:1 desc:fund
* @param name:pub_date type:string require:1 desc:发表日期
*
* @author wangjinleichang
* @url /master/Article/editArticleBase
* @method POST
*
*/
public function editArticleBase()
{
$data = $this->request->post();
if (isset($data['ltai'])) {
$this->editArticleLtai($data['ltai'], $data['article_id']);
}
$updata['icon'] = $data['icon'];
$updata['title'] = trim($data['title']);
$updata['subtitle'] = isset($data['subtitle']) ? trim($data['subtitle']) : '';
$updata['rotation'] = isset($data['rotation']) ? $data['rotation'] : '';
$updata['journal_stage_id'] = $data['journal_stage_id'];
$updata['journal_special_id'] = $data['journal_special_id'];
$updata['tradition_tag'] = $data['tradition_tag'];
$updata['tradition'] = $data['tradition'];
$updata['mhoo'] = $data['mhoo'];
$updata['doi'] = $data['doi'];
$updata['abstract'] = $data['abstract'];
$updata['keywords'] = $data['keywords'];
// $updata['abs_num'] = $data['abs_num'];
// $updata['pdf_num'] = $data['pdf_num'];
// $updata['html_num'] = $data['html_num'];
$updata['npp'] = $data['npp'];
$updata['is_public'] = $data['is_public'];
$updata['type'] = $data['type'];
$updata['cited'] = $data['cited'];
$updata['abbr'] = $data['abbr'];
$updata['fund'] = $data['fund'];
$updata['other_state'] = $data['other_state'];
$updata['file_html'] = $data['file_html'];
$updata['sort'] = $data['sort'];
$updata['pub_date'] = $data['pub_date'];
$res = $this->article_obj->where('article_id', $data['article_id'])->update($updata);
// if($res){
return json(['code' => 0, 'msg' => 'success']);
// }else{
// return json(['code'=>1,'msg'=>'system error']);
// }
}
private function editArticleLtai($ltai, $article_id)
{
$list = explode(',', $ltai);
$has = $this->article_ltai_obj->where('article_id', $article_id)->where('state', 0)->select();
foreach ($has as $val) {
if (in_array($val['content'], $list)) {
foreach ($list as $k => $v) {
if ($val['content'] == $v) {
unset($list[$k]);
}
}
} else {
//删除
$this->article_ltai_obj->where('article_ltai_id', $val['article_ltai_id'])->update(['state' => 1]);
}
}
//增加
foreach ($list as $value) {
$cache['article_id'] = $article_id;
$cache['content'] = $value;
$this->article_ltai_obj->insert($cache);
}
}
/**
* 获取关键词文章
*/
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 编辑文章文件信息
* @param name:article_id type:int require:1 desc:文章id
* @param name:filetype type:string require:1 desc:文件类型(PDF/HTML/SUB/SUB2/endNote/bibTex/CDF)
* @param name:fileURL type:string require:1 desc:文件地址
*
* @author wangjinleichang
* @url /master/Article/editArticleFile
* @method POST
*
*/
public function editArticleFile()
{
$data = $this->request->post();
if ($data['filetype'] == 'PDF') {
$updata['file_pdf'] = $data['fileURL'];
} elseif ($data['filetype'] == 'HTML') {
$updata['file_html'] = $data['fileURL'];
} elseif ($data['filetype'] == 'SUB') {
$updata['file_sub'] = $data['fileURL'];
} elseif ($data['filetype'] == 'SUB2') {
$updata['file_sub2'] = $data['fileURL'];
} elseif ($data['filetype'] == 'endNote') {
$updata['endnote'] = $data['fileURL'];
} elseif ($data['filetype'] == 'bibTex') {
$updata['bibtex'] = $data['fileURL'];
} elseif ($data['filetype'] == 'CDF') {
$updata['file_cdf'] = $data['fileURL'];
}
$this->article_obj->where('article_id', $data['article_id'])->update($updata);
return json(['code' => 0, 'msg' => 'success']);
}
/**
* @title 获取文章列表
* @description 获取文章列表
* @param name:journal_id type:int default:0 require:1 desc:主键
* @param name:journal_stage_id type:int default:0 require:1 desc:主键
* @param name:editor_id type:int require:1 desc:编辑id
* @param name:seach type:string require:0 desc:关键词
* @param name:pageIndex type:int require:1 desc:当前页码数
* @param name:pageSize type:int require:1 desc:单页数据条数
*
* @return count:总数据数
* @return articleList:array#
* @author wangjinleichang
* @url /master/Article/getArticleList
* @method POST
*
*/
public function getArticleList()
{
$data = $this->request->post();
$where['j_article.state'] = 0;
if (intval($data['journal_id']) !== 0) {
$where['j_article.journal_id'] = $data['journal_id'];
} else {
$journals = [];
if (isset($data['editor_id']) && $data['editor_id'] != '') {
$journals = $this->journal_obj->where('editor_id', $data['editor_id'])->column('journal_id');
} else {
$journals = $this->journal_obj->where('state', 0)->column('journal_id');
}
$where['j_article.journal_id'] = ['in', $journals];
}
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'] . '%'];
}
$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_article.sort desc', 'j_article.article_id'])->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->where($where)->count();
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'] = '';
}
$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']))
->where($where)->count();
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 获取文章对应期刊话题
* @param name:article_id type:int require:1 desc:期刊id
*
* @return topics:array#
* @return nowtopic:array#
* @author wangjinlei
* @url /master/Article/getTopicByArticle
* @method POST
*
*/
public function getTopicByArticle()
{
$data = $this->request->post();
$article_info = $this->article_obj->where('article_id', $data['article_id'])->find();
$topic_res = $this->journal_topic_obj->where('journal_id', $article_info['journal_id'])->where('state', 0)->select();
$frag = [];
foreach ($topic_res as $v) {
if ($v['is_final'] == 1) {
$frag[] = $v;
}
}
foreach ($frag as $k => $val) {
$frag[$k]['tname'] = $this->getTname($val, $topic_res);
}
//获取初始话题
$now_list = $this->article_to_topic_obj->where('article_id', $data['article_id'])->where('state', 0)->select();
return json(['code' => 0, 'msg' => 'success', 'data' => ['nowtopic' => $now_list, 'topics' => $frag]]);
}
private function getTname($now, $arr)
{
if ($now['parent_id'] == 0) {
return $now['title'];
} else {
$frag = '>' . $now['title'];
foreach ($arr as $v) {
if ($v['journal_topic_id'] == $now['parent_id']) {
$frag = $this->getTname($v, $arr) . $frag;
}
}
return $frag;
}
}
/**
* @title 增加文章话题
* @description 增加文章话题
* @param name:article_id type:int require:1 desc:期刊id
* @param name:topic_id type:int require:1 desc:话题id
*
* @author wangjinlei
* @url /master/Article/addTopicByArticle
* @method POST
*
*/
public function addTopicByArticle()
{
$data = $this->request->post();
$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']);
if ($res) {
return json(['code' => 0, 'msg' => 'success']);
} else {
return json(['code' => 1, 'msg' => 'system error']);
}
}
private function msg_subscribe_base_topic($topic_id, $article_id)
{
$article_info = $this->article_obj->where('article_id', $article_id)->find();
$topic_info = $this->journal_topic_obj->where('journal_topic_id', $topic_id)->find();
$base_topic_info = $this->base_topic_obj->where('title', $topic_info['title'])->find();
$journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find();
if ($base_topic_info == null) {
return;
}
$list = $this->subscribe_base_topic_obj->where('base_topic_id', $base_topic_info['base_topic_id'])->where('state', 0)->select();
$title = 'These new articles included in TMRDE database are available online.';
$tt = 'Dear Researcher,<br>';
$tt .= 'It is our great honor to present you the articles included in TMRDE.The following new articles have just been included.<br>';
$tt .= '<a href="https://www.tmrjournals.com/article.html?J_num=' . $article_info['journal_id'] . '&a_id=' . $article_id . '">' . $article_info['title'] . '</a><br>';
foreach ($list as $v) {
$tt1 = '';
$tt1 .= $tt;
$tt1 .= '<a href="http://journalapi.tmrjournals.com/public/index.php/api/Journal/UnsubscribeBaseTopic/snum/' . $v['subscribe_base_topic_id'] . '">Unsubscribe</a><br><br>';
$tt1 .= 'Email:' . $journal_info['email'] . '<br>';
$tt1 .= 'Website:' . $journal_info['website'] . '<br><br>';
$tt1 .= 'TMR Publishing Group Ltd.<br>';
$tt1 .= '11 Cockle Bay Rd, Cockle Bay, Auckland, New Zealand<br>';
$tt1 .= 'Tel: +64 02108293806.';
$maidata['email'] = $v['email'];
$maidata['title'] = $title;
$maidata['content'] = $tt1;
$maidata['tmail'] = 'publicrelations@tmrjournals.com';
$maidata['tpassword'] = 'pRWU999999';
Queue::push('app\api\job\mail@fire', $maidata, "mail");
}
}
private function msg_subscript_topic($topic_id, $article_id)
{
$article_info = $this->article_obj->where('article_id', $article_id)->find();
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $article_info['journal_stage_id'])->find();
$topic_info = $this->journal_topic_obj->where('journal_topic_id', $topic_id)->find();
$journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find();
$list = [];
if ($topic_info['level'] == 2) {
$list = $this->subscribe_topic_obj->where('topic_id', $topic_id)->where('state', 0)->select();
} else {
$list = $this->subscribe_topic_obj->where('topic_id', $topic_info['parent_id'])->where('state', 0)->select();
}
//组成文章信息
$tt1 = '<div style="background-color: #ededed;margin: 0;">
<div class="con_content" style="font-family: Arial;
width: 600px;
margin: 0 auto;
background-color: #fff;
padding: 30px 40px;
color: #1B3051;
font-size: 14px;
line-height: 20px;">
<div>
<img style="width: 80px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATUAAABWCAYAAACuCAFEAAAKQ2lDQ1BJQ0MgcHJvZmlsZQAAeNqdU3dYk/cWPt/3ZQ9WQtjwsZdsgQAiI6wIyBBZohCSAGGEEBJAxYWIClYUFRGcSFXEgtUKSJ2I4qAouGdBiohai1VcOO4f3Ke1fXrv7e371/u855zn/M55zw+AERImkeaiagA5UoU8Otgfj09IxMm9gAIVSOAEIBDmy8JnBcUAAPADeXh+dLA//AGvbwACAHDVLiQSx+H/g7pQJlcAIJEA4CIS5wsBkFIAyC5UyBQAyBgAsFOzZAoAlAAAbHl8QiIAqg0A7PRJPgUA2KmT3BcA2KIcqQgAjQEAmShHJAJAuwBgVYFSLALAwgCgrEAiLgTArgGAWbYyRwKAvQUAdo5YkA9AYACAmUIszAAgOAIAQx4TzQMgTAOgMNK/4KlfcIW4SAEAwMuVzZdL0jMUuJXQGnfy8ODiIeLCbLFCYRcpEGYJ5CKcl5sjE0jnA0zODAAAGvnRwf44P5Dn5uTh5mbnbO/0xaL+a/BvIj4h8d/+vIwCBAAQTs/v2l/l5dYDcMcBsHW/a6lbANpWAGjf+V0z2wmgWgrQevmLeTj8QB6eoVDIPB0cCgsL7SViob0w44s+/zPhb+CLfvb8QB7+23rwAHGaQJmtwKOD/XFhbnauUo7nywRCMW735yP+x4V//Y4p0eI0sVwsFYrxWIm4UCJNx3m5UpFEIcmV4hLpfzLxH5b9CZN3DQCshk/ATrYHtctswH7uAQKLDljSdgBAfvMtjBoLkQAQZzQyefcAAJO/+Y9AKwEAzZek4wAAvOgYXKiUF0zGCAAAR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K9IC4S71rTywqioRpuuaXN3OOeMQ0ZN3/ECduNNh+r1GTzVqLyPUPXCBvyyjFZMJ/JjmMDwdOdjxy5ocQr06sjoMBN4ootUeu204445ufoLu/y7+U+/upZ/uKCEl1it4DlAYJBcKMApvejCq/DHlT2uI+++ACM1osaFq512xDEXjfvyjMSSq39zovf221VGmaVAjW3uAOmHPZBiLpnHVXluse1YesNVwJvX8HwGWrRcBSSrgzaPYTWUguUkmp3yXXa9hu311eCASIBoqoH0u2EkYDY4TXWQXVUPoRkHQtVll49I1W2sSixeUDdy730nU6Vdj1K5GjaAu3oxOG88AakFHwOsWAuRo74zIXTC6dun1y+D9JoNkKlvLA2NG7enxM9niSbgm+pA1q0GuXAuJDasDf2/AAMA78W/29pXYvsAAAAASUVORK5CYII=" alt="">
</div><br><br>';
$tt1 .= $journal_info['title'] . '<br><br>';
$tt1 .= 'The following new articles have just been published in Topic "' . $topic_info['title'] . '" of ' . $journal_info['title'] . '<br><br>';
$tt1 .= $article_info['type'] . '<br>';
$tt1 .= '<a href="https://www.tmrjournals.com/article.html?J_num=' . $journal_info['journal_id'] . '&a_id=' . $article_info['article_id'] . '">' . $article_info['title'] . '</a><br>';
$tt1 .= $this->getAuthor($article_info) . '<br>';
$tt1 .= $journal_info['title'] . ' ' . $stage_info['stage_year'] . ' ' . $stage_info['stage_vol'] . "(" . $stage_info['stage_no'] . "). https://doi.org/" . $article_info['doi'] . '<br>';
$tt1 .= '<a href="https://www.tmrjournals.com/public/articlePDF/' . $article_info['file_pdf'] . '">Download pdf</a><br><br><br>';
$tt2 = 'Email: ' . $journal_info['email'] . '<br>';
$tt2 .= 'Website: https://www.tmrjournals.com/' . $journal_info['usx'] . '<br>';
$tt2 .= 'TMR Publishing Group Ltd.<br>';
$tt2 .= '11 Cockle Bay Rd, Cockle Bay, Auckland, New Zealand<br>';
$tt2 .= 'Tel: +64 02108293806.';
$tt2 .= '</div>
</div>';
foreach ($list as $v) {
$cache = $tt1 . '<a href="http://journalapi.tmrjournals.com/public/index.php/api/Journal/UnsubscribeTopic/snum/' . $v['subscribe_topic_id'] . '">Unsubscribe</a><br><br>' . $tt2;
$maidata['email'] = $v['email'];
$maidata['title'] = $journal_info['title'];
$maidata['content'] = $cache;
$maidata['tmail'] = 'publicrelations@tmrjournals.com';
$maidata['tpassword'] = 'pRWU999999';
Queue::push('app\api\job\mail@fire', $maidata, "mail");
}
}
private function getAuthor($article)
{
$where['article_id'] = $article['article_id'];
$where['state'] = 0;
$list = $this->article_author_obj->where($where)->select();
$frag = '';
foreach ($list as $k => $v) {
$frag = $frag == '' ? '' . $v['author_name'] : $frag . ', ' . $v['author_name'];
}
return $frag;
}
/**
* @title 删除文章话题
* @description 删除文章话题
* @param name:article_to_topic_id type:int require:1 desc:主键id
*
* @author wangjinlei
* @url /master/Article/delTopic
* @method POST
*
*/
public function delTopic()
{
$data = $this->request->post();
$res = $this->article_to_topic_obj->where('article_to_topic_id', $data['article_to_topic_id'])->update(['state' => 1]);
if ($res) {
return json(['code' => 0, 'msg' => 'success']);
} else {
return json(['code' => 1, 'msg' => 'system error']);
}
}
// public function mycc() {
// $list = $this->article_author_obj->where('article_author_id', '>', 5126)->select();
// foreach ($list as $v) {
// $ca = explode(' ', $v['author_name']);
// $caf = '';
// $cal = '';
// if (isset($ca[0])) {
// $caf = str_replace('-', '', $ca[0]);
// }
// if (isset($ca[1])) {
// $cal = $ca[1];
// }
// $this->article_author_obj->where('article_author_id', $v['article_author_id'])->update(['first_name' => $caf, 'last_name' => $cal]);
// }
// echo 'over';
// }
/**
* @title 图片上传
* @description 图片上传
* @param name:name type:string require:1 default:articleicon desc:文件域名称
*
* @return upurl:图片地址
* @author wangjinlei
* @url /master/Article/up_article_file
* @method POST
*
*/
public function up_article_file()
{
$file = request()->file('articleicon');
if ($file) {
$info = $file->move(ROOT_PATH . 'public' . DS . 'articleicon');
if ($info) {
return json(['code' => 0, 'msg' => 'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
} else {
return json(['code' => 1, 'msg' => $file->getError()]);
}
}
}
/**
* @title 轮播图上传
* @description 轮播图上传
* @param name:name type:string require:1 default:rotation desc:文件域名称
*
* @return upurl:图片地址
* @author wangjinlei
* @url /master/Article/up_rotation_file
* @method POST
*
*/
public function up_rotation_file()
{
$file = request()->file('rotation');
if ($file) {
$info = $file->move(ROOT_PATH . 'public' . DS . 'rotation');
if ($info) {
return json(['code' => 0, 'msg' => 'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
} else {
return json(['code' => 1, 'msg' => $file->getError()]);
}
}
}
/**
* @title cite图片上传
* @description cite图片上传
* @param name:name type:string require:1 default:articleCite desc:文件域名称
*
* @return upurl:图片地址
* @author wangjinlei
* @url /master/Article/up_cite_file
* @method POST
*
*/
public function up_cite_file()
{
$file = request()->file('articleCite');
if ($file) {
$info = $file->move(ROOT_PATH . 'public' . DS . 'articleCite');
if ($info) {
return json(['code' => 0, 'msg' => 'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
} else {
return json(['code' => 1, 'msg' => $file->getError()]);
}
}
}
/**
* @title CDF文件上传
* @description CDF文件上传
* @param name:name type:string require:1 default:articleCDF desc:文件域名称
*
* @return upurl:图片地址
* @author wangjinlei
* @url /master/Article/up_cdf_file
* @method POST
*
*/
public function up_cdf_file()
{
$file = request()->file('articleCDF');
if ($file) {
$info = $file->move(ROOT_PATH . 'public' . DS . 'articleCDF');
if ($info) {
return json(['code' => 0, 'msg' => 'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
} else {
return json(['code' => 1, 'msg' => $file->getError()]);
}
}
}
/**
* @title imgCome文件上传
* @description imgCome文件上传
* @param name:name type:string require:1 default:imgCome desc:文件域名称
*
* @return upurl:图片地址
* @author wangjinlei
* @url /master/Article/up_imgCome_file
* @method POST
*
*/
public function up_imgCome_file()
{
$file = request()->file('imgCome');
if ($file) {
$info = $file->move(ROOT_PATH . 'public' . DS . 'imgCome');
if ($info) {
return json(['code' => 0, 'msg' => 'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
} else {
return json(['code' => 1, 'msg' => $file->getError()]);
}
}
}
public function getArticleReportAuthors()
{
$num = $this->request->post('num');
$size = 500;
$f = ($num - 1) * $size;
$list = $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.state', 0)->limit($f, $size)->select();
foreach ($list as $k => $v) {
$author = $this->article_author_obj->where('article_id', $v['article_id'])->where('is_report', 1)->where('state', 0)->select();
$list[$k]['author'] = $author;
}
$re['list'] = $list;
return jsonSuccess($re);
}
/**
* @title 文章文件上传
* @description 文章文件上传
* @param name:name type:string require:1 desc:文件域名称(articlePDF/articleHTML/articleSUB/articleSUB2/bibTex/endNote/articleCDF)
* @param name:type type:string require:1 desc:pathinfo(articlePDF/articleHTML/articleSUB/articleSUB2/bibTex/endNote/articleCDF)
*
* @return upurl:图片地址
* @author wangjinlei
* @url /master/Article/article_file
* @method GET
*
*/
public function article_file($type)
{
$file = request()->file($type);
if ($file) {
$info = $file->move(ROOT_PATH . 'public' . DS . $type);
if ($info) {
return json(['code' => 0, 'msg' => 'success', 'upurl' => str_replace("\\", "/", $info->getSaveName())]);
} else {
return json(['code' => 1, 'msg' => $file->getError()]);
}
}
}
/**
* @title 获取城市列表
* @description 获取城市列表
* @return countrys:array#
* @author wangjinlei
* @url /master/Article/getCountrys
* @method POST
*
*/
public function getCountrys()
{
$res = $this->country_obj->order('en_name')->select();
return json(['code' => 0, 'msg' => 'success', 'data' => ['countrys' => $res]]);
}
/**
* @title 获取客座话题
* @description 获取客座话题
* @param name:journal_id type:int require:1 desc:期刊id
*
* @return specials:客座期刊array#
* @author wangjinlei
* @url /master/Article/getJournalSpecials
* @method POST
*
*/
public function getJournalSpecials()
{
$data = $this->request->post();
$list = $this->journal_special_obj->where('journal_id', $data['journal_id'])->where('state', 2)->select();
$re['specials'] = $list;
return jsonSuccess($re);
}
/**
* @title 添加文章引用申请
* @description 添加文章引用申请
* @param name:article_id type:int require:1 desc:文章id
* @param name:journal_id type:int require:1 desc:期刊id
* @param name:img type:string require:1 desc:地址
* @param name:journal_name type:string require:1 desc:期刊名
* @param name:article_name type:string require:1 desc:文章名
* @param name:factor type:string require:1 desc:影响因子
* @param name:adate type:string require:1 desc:引用时间
*
* @return specials:客座期刊array#
* @author wangjinlei
* @url /master/Article/addArticleCite
* @method POST
*
*/
public function addArticleCite()
{
$data = $this->request->post();
$insert['article_id'] = $data['article_id'];
$insert['journal_id'] = $data['journal_id'];
$insert['img'] = $data['img'];
$insert['journal_name'] = $data['journal_name'];
$insert['article_name'] = $data['article_name'];
$insert['factor'] = $data['factor'];
$insert['date'] = $data['adate'];
$insert['ctime'] = time();
$this->article_cite_obj->insert($insert);
return jsonSuccess([]);
}
/**
* @title 获取文章引用申请列表(编辑)
* @description 获取文章引用申请列表
* @param name:admin_id type:int require:1 desc:管理员id
*
* @return cites:信息array#
* @author wangjinlei
* @url /master/Article/getArticleCites
* @method POST
*
*/
public function getArticleCites()
{
$data = $this->request->post();
$journals = $this->journal_obj->where('editor_id', $data['admin_id'])->where('state', 0)->column('journal_id');
$list = $this->article_cite_obj
->field('j_article_cite.*,j_journal.title journal_title')
->join('j_journal', 'j_journal.journal_id = j_article_cite.journal_id', 'left')
->where('j_article_cite.journal_id', 'in', $journals)
->order('j_article_cite.state asc,j_article_cite.article_cite_id asc')
->select();
$re['cites'] = $list;
return jsonSuccess($re);
}
/**
* @title 获取文章引用列表(编辑)
* @description 获取文章引用列表
* @param name:article_id type:int require:1 desc:文章id
*
* @return cites:信息array#
* @return article:文章信息#
* @author wangjinlei
* @url /master/Article/getCitesByArticle
* @method POST
*
*/
public function getCitesByArticle()
{
$data = $this->request->post();
$article_info = $this->article_obj->where('article_id', $data['article_id'])->find();
$list = $this->article_cite_obj->where('article_id', $data['article_id'])->order('state asc,article_cite_id asc')->select();
$re['article'] = $article_info;
$re['cites'] = $list;
return jsonSuccess($re);
}
/**
* @title 获取文章引用申请列表(管理员)
* @description 获取文章引用申请列表(管理员)
* @param name:state type:int require:1 desc:状态-1,0,1,2
* @param name:pageIndex type:int require:1 desc:当前页码数
* @param name:pageSize type:int require:1 desc:单页数据条数
*
* @return count:总数
* @return cites:信息array#
* @author wangjinlei
* @url /master/Article/getAllArticleCites
* @method POST
*
*/
public function getAllArticleCites()
{
$data = $this->request->post();
$where = [];
if ($data['state'] >= 0) {
$where['j_article_cite.state'] = $data['state'];
}
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
$list = $this->article_cite_obj
->field('j_article_cite.*,j_journal.title journal_title')
->join('j_journal', 'j_journal.journal_id = j_article_cite.journal_id', 'left')
->where($where)
->order('j_article_cite.state asc,j_article_cite.article_cite_id asc')
->limit($limit_start, $data['pageSize'])
->select();
$count = $this->article_cite_obj->where($where)->count();
$re['count'] = $count;
$re['cites'] = $list;
return jsonSuccess($re);
}
/**
* @title 获取文章引用详情
* @description 获取文章引用详情
* @param name:article_cite_id type:int require:1 desc:主键
*
* @return cite:信息#
* @author wangjinlei
* @url /master/Article/getCiteDetail
* @method POST
*
*/
public function getCiteDetail()
{
$data = $this->request->post();
$cite_info = $this->article_cite_obj->where('article_cite_id', $data['article_cite_id'])->find();
$re['cite'] = $cite_info;
return jsonSuccess($re);
}
/**
* @title 审核文章引用
* @description 审核文章引用
* @param name:article_cite_id type:int require:1 desc:主键
* @param name:state type:int require:1 desc:状态1通过2驳回
* @author wangjinlei
* @url /master/Article/changeCiteState
* @method POST
*
*/
public function changeCiteState()
{
$data = $this->request->post();
$this->article_cite_obj->where('article_cite_id', $data['article_cite_id'])->update(['state' => $data['state'], 'atime' => time()]);
if ($data['state'] == 1) {
$info = $this->article_cite_obj->where('article_cite_id', $data['article_cite_id'])->find();
$this->article_obj->where('article_id', $info['article_id'])->setInc('cited');
}
return jsonSuccess([]);
}
/**
* @title 获取期刊引用
* @description 获取期刊引用
* @param name:issn type:string require:1 desc:issn号
* @author wangjinlei
* @url /master/Article/getJournalCites
* @method POST
*
*/
public function getJournalCites()
{
$data = $this->request->post();
$journal_info = $this->journal_obj->where('issn', $data['issn'])->find();
$c_time = strtotime("-1 month", strtotime(date('Y-m') . '-26 00:00:00'));
$c_time1 = strtotime(date('Y-m' . '-25 23:59:59'));
$where['journal_id'] = $journal_info['journal_id'];
$where['atime'] = array(['>', $c_time], ['<=', $c_time1]);
$where['state'] = 1;
$list = $this->article_cite_obj->where($where)->select();
$re['cites'] = $list;
return jsonSuccess($re);
}
/**
* @title 推送crossref
* @description 推送crossref
* @param name:doi_num type:string require:1 desc:doi号
* @param name:article_id type:int require:1 desc:文章id
* @author wangjinlei
* @url /master/Article/pushCrossref
* @method POST
*
*/
public function pushCrossref()
{
$data = $this->request->post();
$has = $this->article_obj->where('doi', '10.53388/' . $data['doi_num'])->find();
if ($has) {
return jsonError('doi号重复');
}
if (strstr($data['doi_num'], '/') !== false) {
return jsonError('格式错误');
}
$author = $this->article_author_obj->where('article_id', $data['article_id'])->where('state', 0)->find();
if ($author == null) {
return jsonError('请先上传作者');
}
$article_info = $this->article_obj->where('article_id', $data['article_id'])->find();
if ($article_info['npp'] == '') {
return jsonError('请先上传页码');
}
$url = 'https://doi.crossref.org/servlet/deposit';
$file = ROOT_PATH . 'public' . DS . 'xml' . DS . $data['article_id'] . '.xml';
$this->crossRef($data);
//存储
$this->article_obj->where('article_id', $data['article_id'])->update(['doi' => '10.53388/' . $data['doi_num']]);
//发送请求
$par['login_id'] = 'books@tmrjournals.com/tmrp';
$par['login_passwd'] = '849192806pnX';
$par['fname'] = new \CURLFile($file);
$this->myPost($url, $par);
return jsonSuccess([]);
}
private function myPost($url, $param = array())
{
// if (!is_array($param)) {
// throw new Exception("参数必须为array");
// }
$httph = curl_init($url);
curl_setopt($httph, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($httph, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
curl_setopt($httph, CURLOPT_POST, 1); //设置为POST方式
curl_setopt($httph, CURLOPT_POSTFIELDS, $param);
$res = curl_exec($httph);
curl_close($httph);
return $res;
// echo '<pre>';
// var_dump($rst);
// echo '</pre>';
// echo '<pre>';
// var_dump($err);
// echo '</pre>';
// die;
// die;
}
// public function cccc(){
// die;
// $data = $this->request->post();
// $rule = new Validate([
// 'num'=>'require'
// ]);
// if(!$rule->check($data)){
// return jsonError($rule->getError());
// }
// $limit_start = ($data['num'] - 1) * 20;
// $list = $this->article_obj->where('doi','like',"10.12032%")->where('state',0)->limit($limit_start,20)->select();
// foreach($list as $v){
// $c = explode('/',$v['doi']);
// $author = $this->article_author_obj->where('article_id', $v['article_id'])->where('state', 0)->find();
// if ($author == null) {
// continue;
// }
// $article_info = $this->article_obj->where('article_id', $v['article_id'])->find();
// if ($article_info['npp'] == '') {
// continue;
// }
// $url = 'https://doi.crossref.org/servlet/deposit';
// $file = ROOT_PATH . 'public' . DS . 'xml' . DS . $v['article_id'] . '.xml';
// $d['article_id'] = $v['article_id'];
// $d['doi_num'] = $c[1];
// $this->crossRef($d);
// //存储
// $this->article_obj->where('article_id', $v['article_id'])->update(['doi' => '10.53388/' . $c[1]]);
// //发送请求
// $par['login_id'] = 'books@tmrjournals.com/tmrp';
// $par['login_passwd'] = '849192806pnX';
// $par['fname'] = new \CURLFile($file);
// $this->myPost($url, $par);
// // echo '10.53388/'.$c[1];
// // echo '<br/>';
// }
// // dump($list);
// }
public function crossRef($data)
{
$xml = '';
//create xml 头
$xml .= '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL;
$xml .= '<doi_batch version="4.3.7" xmlns="http://www.crossref.org/schema/4.3.7" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.crossref.org/schema/4.3.7 http://www.crossref.org/schemas/crossref4.3.7.xsd">' . PHP_EOL . PHP_EOL;
$xml .= '<head>' . PHP_EOL;
$xml .= '<doi_batch_id>' . date('Ymd') . '</doi_batch_id>' . PHP_EOL;
$xml .= '<timestamp>' . date('YmdHis') . '</timestamp>' . PHP_EOL;
$xml .= '<depositor>' . PHP_EOL;
$xml .= '<depositor_name>tmr@tmrjournals.com</depositor_name>' . PHP_EOL;
$xml .= '<email_address>tmr@tmrjournals.com</email_address>' . PHP_EOL;
$xml .= '</depositor>' . PHP_EOL;
$xml .= '<registrant>TMR</registrant>' . PHP_EOL;
$xml .= '</head>' . PHP_EOL;
//组装主体信息部分
$article_info = $this->article_obj->where('article_id', $data['article_id'])->find();
$journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find();
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $article_info['journal_stage_id'])->find();
$xml .= '<body>' . PHP_EOL;
$xml .= '<journal>' . PHP_EOL;
$xml .= '<journal_metadata language="en">' . PHP_EOL;
$xml .= '<full_title>' . str_replace("&", "and", $journal_info['title']) . '</full_title>' . PHP_EOL;
$xml .= '<abbrev_title>' . str_replace('&', 'and', $journal_info['jabbr']) . '</abbrev_title>' . PHP_EOL;
$xml .= '<issn media_type="print">' . $journal_info['issn'] . '</issn>' . PHP_EOL;
$xml .= '<coden>' . $journal_info['usx'] . '</coden>' . PHP_EOL;
$xml .= '</journal_metadata>' . PHP_EOL;
$xml .= '<journal_issue>' . PHP_EOL;
$xml .= '<publication_date media_type="print">' . PHP_EOL;
$xml .= '<year>' . $stage_info['stage_year'] . '</year>' . PHP_EOL;
$xml .= '</publication_date>' . PHP_EOL;
$xml .= '<journal_volume>' . PHP_EOL;
$xml .= '<volume>' . $stage_info['stage_vol'] . '</volume>' . PHP_EOL;
$xml .= '</journal_volume>' . PHP_EOL;
$xml .= '<issue>' . $stage_info['stage_no'] . '</issue>' . PHP_EOL;
$xml .= '</journal_issue>' . PHP_EOL;
$xml .= '<journal_article publication_type="full_text">' . PHP_EOL;
$xml .= '<titles>' . PHP_EOL;
$xml .= '<title>' . str_replace("&", "and", $article_info['title']) . '</title>' . PHP_EOL;
$xml .= '</titles>' . PHP_EOL;
$xml .= '<contributors>' . PHP_EOL;
$authors = $this->article_author_obj->where('article_id', $data['article_id'])->where('state', 0)->select();
foreach ($authors as $v) {
if ($v['is_first'] == 1) {
$xml .= '<person_name sequence="first" contributor_role="author">' . PHP_EOL;
} else {
$xml .= '<person_name sequence="additional" contributor_role="author">' . PHP_EOL;
}
$xml .= '<given_name>' . $v['first_name'] . '</given_name>' . PHP_EOL;
$xml .= '<surname>' . ($v['last_name'] == '' ? $v['first_name'] : $v['last_name']) . '</surname>' . PHP_EOL;
$xml .= '</person_name>' . PHP_EOL;
}
$xml .= '</contributors>' . PHP_EOL;
$xml .= '<publication_date media_type="print">' . PHP_EOL;
$xml .= '<year>' . $stage_info['stage_year'] . '</year>' . PHP_EOL;
$xml .= '</publication_date>' . PHP_EOL;
$xml .= '<pages>' . PHP_EOL;
$ca = explode('-', $article_info['npp']);
$xml .= '<first_page>' . $ca[0] . '</first_page>' . PHP_EOL;
$xml .= '</pages>' . PHP_EOL;
$xml .= '<publisher_item>' . PHP_EOL;
$xml .= '<identifier id_type="pii">' . trim($data['doi_num']) . '</identifier>' . PHP_EOL;
$xml .= '</publisher_item>' . PHP_EOL;
$xml .= '<doi_data>' . PHP_EOL;
$xml .= '<doi>10.53388/' . trim($data['doi_num']) . '</doi>' . PHP_EOL;
$xml .= '<resource><![CDATA[https://www.tmrjournals.com/article.html?J_num=' . $journal_info['journal_id'] . '&a_id=' . $article_info['article_id'] . ']]></resource>' . PHP_EOL;
$xml .= '<collection property="crawler-based">' . PHP_EOL;
$xml .= '<item crawler="iParadigms">' . PHP_EOL;
$xml .= '<resource><![CDATA[https://www.tmrjournals.com/public/articlePDF/' . $article_info['file_pdf'] . ']]></resource>' . PHP_EOL;
$xml .= '</item>' . PHP_EOL;
$xml .= '</collection>' . PHP_EOL;
$xml .= '</doi_data>' . PHP_EOL;
$xml .= '</journal_article>' . PHP_EOL;
$xml .= '</journal>' . PHP_EOL;
$xml .= '</body>' . PHP_EOL;
$xml .= '</doi_batch>' . PHP_EOL;
$txt = ROOT_PATH . 'public' . DS . 'xml' . DS . $article_info['article_id'] . '.xml';
file_put_contents($txt, $xml);
}
private function changDOI()
{
$list = $this->article_obj->where('journal_id', 14)->where('state', 0)->select();
foreach ($list as $art) {
$ca_doi = explode('/', $art['doi']);
if (!isset($ca_doi[1])) {
continue;
}
$doi = '10.53388/' . $ca_doi[1];
$this->article_obj->where('article_id', $art['article_id'])->update(['doi' => $doi]);
}
}
/**
* 生成xml文件
*/
private function makeXML()
{
$xml = '';
//create xml 头
$xml .= '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL;
$xml .= '<doi_batch version="4.3.7" xmlns="http://www.crossref.org/schema/4.3.7" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.crossref.org/schema/4.3.7 http://www.crossref.org/schemas/crossref4.3.7.xsd">' . PHP_EOL . PHP_EOL;
$xml .= '<head>' . PHP_EOL;
$xml .= '<doi_batch_id>' . date('Ymd') . '</doi_batch_id>' . PHP_EOL;
$xml .= '<timestamp>' . date('YmdHis') . '</timestamp>' . PHP_EOL;
$xml .= '<depositor>' . PHP_EOL;
$xml .= '<depositor_name>tmr@tmrjournals.com</depositor_name>' . PHP_EOL;
$xml .= '<email_address>tmr@tmrjournals.com</email_address>' . PHP_EOL;
$xml .= '</depositor>' . PHP_EOL;
$xml .= '<registrant>TMR</registrant>' . PHP_EOL;
$xml .= '</head>' . PHP_EOL;
$xml .= '<body>' . PHP_EOL;
//组装主体信息部分
$journal_info = $this->journal_obj->where('journal_id', 14)->find();
// $article_info = $this->article_obj->where('article_id', $data['article_id'])->find();
$stage_list = $this->journal_stage_obj->where('journal_id', 14)->where('state', 0)->select();
foreach ($stage_list as $stage) {
$xml .= '<journal>' . PHP_EOL;
$xml .= '<journal_metadata language="en">' . PHP_EOL;
$xml .= '<full_title>' . $journal_info['title'] . '</full_title>' . PHP_EOL;
$xml .= '<abbrev_title>' . $journal_info['jabbr'] . '</abbrev_title>' . PHP_EOL;
$xml .= '<issn media_type="print">' . $journal_info['issn'] . '</issn>' . PHP_EOL;
$xml .= '<coden>' . $journal_info['usx'] . '</coden>' . PHP_EOL;
$xml .= '</journal_metadata>' . PHP_EOL;
$xml .= '<journal_issue>' . PHP_EOL;
$xml .= '<publication_date media_type="print">' . PHP_EOL;
$xml .= '<year>' . $stage['stage_year'] . '</year>' . PHP_EOL;
$xml .= '</publication_date>' . PHP_EOL;
$xml .= '<journal_volume>' . PHP_EOL;
$xml .= '<volume>' . $stage['stage_vol'] . '</volume>' . PHP_EOL;
$xml .= '</journal_volume>' . PHP_EOL;
$xml .= '<issue>' . $stage['stage_no'] . '</issue>' . PHP_EOL;
$xml .= '</journal_issue>' . PHP_EOL;
$art_list = $this->article_obj->where('journal_stage_id', $stage['journal_stage_id'])->where('state', 0)->select();
foreach ($art_list as $art) {
$ca_doi = explode('/', $art['doi']);
if (!isset($ca_doi[1])) {
continue;
}
$doi = '10.53388/' . $ca_doi[1];
$xml .= '<journal_article publication_type="full_text">' . PHP_EOL;
$xml .= '<titles>' . PHP_EOL;
$xml .= '<title>' . $art['title'] . '</title>' . PHP_EOL;
$xml .= '</titles>' . PHP_EOL;
$xml .= '<contributors>' . PHP_EOL;
$authors = $this->article_author_obj->where('article_id', $art['article_id'])->where('state', 0)->select();
foreach ($authors as $v) {
if ($v['is_first'] == 1) {
$xml .= '<person_name sequence="first" contributor_role="author">' . PHP_EOL;
} else {
$xml .= '<person_name sequence="additional" contributor_role="author">' . PHP_EOL;
}
$xml .= '<given_name>' . $v['first_name'] . '</given_name>' . PHP_EOL;
$xml .= '<surname>' . ($v['last_name'] == '' ? $v['first_name'] : $v['last_name']) . '</surname>' . PHP_EOL;
$xml .= '</person_name>' . PHP_EOL;
}
$xml .= '</contributors>' . PHP_EOL;
$xml .= '<publication_date media_type="print">' . PHP_EOL;
$xml .= '<year>' . $stage['stage_year'] . '</year>' . PHP_EOL;
$xml .= '</publication_date>' . PHP_EOL;
$xml .= '<pages>' . PHP_EOL;
$ca = explode('-', $art['npp']);
$xml .= '<first_page>' . $ca[0] . '</first_page>' . PHP_EOL;
$xml .= '</pages>' . PHP_EOL;
$xml .= '<publisher_item>' . PHP_EOL;
$xml .= '<identifier id_type="pii">' . $doi . '</identifier>' . PHP_EOL;
$xml .= '</publisher_item>' . PHP_EOL;
$xml .= '<doi_data>' . PHP_EOL;
$xml .= '<doi>' . $doi . '</doi>' . PHP_EOL;
$xml .= '<resource><![CDATA[https://www.tmrjournals.com/article.html?J_num=' . $journal_info['journal_id'] . '&a_id=' . $art['article_id'] . ']]></resource>' . PHP_EOL;
$xml .= '</doi_data>' . PHP_EOL;
$xml .= '</journal_article>' . PHP_EOL;
}
$xml .= '</journal>' . PHP_EOL;
}
$xml .= '</body>' . PHP_EOL;
$xml .= '</doi_batch>' . PHP_EOL;
$txt = ROOT_PATH . 'public' . DS . 'xml' . DS . 'all_1.xml';
file_put_contents($txt, $xml);
}
/**
* @title 增加相关文章
* @description 增加相关文章
* @param name:article_id type:int require:1 desc:文章id
* @param name:add_article_id type:int require:1 desc:增加的文章id
* @author wangjinlei
* @url /master/Article/addRelatedArticle
* @method POST
*
*/
public function addRelatedArticle()
{
$data = $this->request->post();
$rule = new Validate([
'article_id' => 'require',
'add_article_id' => 'require'
]);
if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$article_info = $this->article_obj->where('article_id', $data['article_id'])->find();
$frag = [];
if ($article_info['related'] == "") {
$frag[] = $data['add_article_id'];
} else {
if (in_array($data['add_article_id'], object_to_array(json_decode($article_info['related'])))) {
return jsonError("重复添加!!");
}
$frag = array_merge(object_to_array(json_decode($article_info['related'])), [$data['add_article_id']]);
}
$this->article_obj->where("article_id", $data['article_id'])->update(['related' => json_encode($frag)]);
return jsonSuccess([]);
}
/**
* @title 删除相关文章
* @description 删除相关文章
* @param name:article_id type:int require:1 desc:文章id
* @param name:del_article_id type:int require:1 desc:增加的文章id
* @author wangjinlei
* @url /master/Article/delRelatedArticle
* @method POST
*
*/
public function delRelatedArticle()
{
$data = $this->request->post();
$article_info = $this->article_obj->where("article_id", $data['article_id'])->find();
$frag = object_to_array(json_decode($article_info['related']));
foreach ($frag as $k => $v) {
if ($v == $data['del_article_id']) {
unset($frag[$k]);
}
}
$this->article_obj->where("article_id", $data['article_id'])->update(['related' => json_encode($frag)]);
return jsonSuccess([]);
}
/**
* @title 获取相关文章
* @description 获取相关文章
* @param name:article_id type:int require:1 desc:文章id
*
* @return articles:文章列表#
* @author wangjinlei
* @url /master/Article/getRelatedArticles
* @method POST
*
*/
public function getRelatedArticles()
{
$data = $this->request->post();
$article_info = $this->article_obj->where("article_id", $data['article_id'])->find();
$list = $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.article_id", "in", object_to_array(json_decode($article_info['related'])))
->select();
$re['articles'] = $list;
return jsonSuccess($re);
}
/**
* @title 获取期刊全部文章按分期划分
* @description 获取期刊全部文章按分期划分
* @param name:journal_id type:int require:1 desc:期刊id
*
* @return stages:文章列表#
* @author wangjinlei
* @url /master/Article/getArticlesByStages
* @method POST
*
*/
public function getArticlesByStages()
{
$data = $this->request->post();
//获取期刊分期
$stage = $this->journal_stage_obj->where('journal_id', $data['journal_id'])->where("state", 0)->order('stage_vol desc,stage_no')->select();
foreach ($stage as $k => $v) {
$stage[$k]['articles'] = $this->article_obj->where('journal_stage_id', $v['journal_stage_id'])->where('state', 0)->select();
}
$re['stages'] = $stage;
return jsonSuccess($re);
}
/**
* @title 注册doi
* @description 注册doi
* @param name:doi type:string require:1 desc:doi号
* @param name:article_id type:int require:1 desc:文章id
* @author wangjinlei
* @url /master/Article/agentDOI
* @method POST
*
*/
public function agentDOI()
{
$data = $this->request->post();
// $data['doi'] = '10.12032/TMR20210301222';
// $data['article_id'] = 1333;
$xml = '';
//create xml 头
$xml .= '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL;
$xml .= '<doi_batch version="1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="D:\jboss-4.0.3SP1\wanfang\jboss-4.0.3SP1\server\default\deploy\WanFang.war\check.xsd">' . PHP_EOL . PHP_EOL;
$xml .= '<head>' . PHP_EOL;
$xml .= '<doi_batch_id>' . date('Ymd') . '</doi_batch_id>' . PHP_EOL;
$xml .= '<timestamp>' . date('YmdHis') . '</timestamp>' . PHP_EOL;
$xml .= '<depositor>' . PHP_EOL;
$xml .= '<name>TMR2015@163.com</name>' . PHP_EOL;
$xml .= '<email_address>TMR2015@163.com</email_address>' . PHP_EOL;
$xml .= '</depositor>' . PHP_EOL;
$xml .= '<registrant>传统医学研究(英文版)</registrant>' . PHP_EOL;
$xml .= '</head>' . PHP_EOL;
//组装主体信息部分
$article_info = $this->article_obj->where('article_id', $data['article_id'])->find();
$journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find();
$stage_info = $this->journal_stage_obj->where('journal_stage_id', $article_info['journal_stage_id'])->find();
$xml .= '<body>' . PHP_EOL;
$xml .= '<journal>' . PHP_EOL;
$xml .= '<journal_metadata>' . PHP_EOL;
$xml .= '<journal_id>' . $journal_info['usx'] . '</journal_id>' . PHP_EOL;
$xml .= '<full_title>' . $journal_info['title'] . '</full_title>' . PHP_EOL;
$xml .= '<issn media_type="print">' . $journal_info['issn'] . '</issn>' . PHP_EOL;
$xml .= '<cn media_type="print"></cn>' . PHP_EOL;
$xml .= '</journal_metadata>' . PHP_EOL;
$xml .= '<journal_issue>' . PHP_EOL;
$xml .= '<publication_date media_type="print">' . PHP_EOL;
$xml .= '<year>' . $stage_info['stage_year'] . '</year>' . PHP_EOL;
$xml .= '<month/>' . PHP_EOL;
$xml .= '<day/>' . PHP_EOL;
$xml .= '</publication_date>' . PHP_EOL;
$xml .= '<journal_volume>' . PHP_EOL;
$xml .= '<volume>' . $stage_info['stage_vol'] . '</volume>' . PHP_EOL;
$xml .= '</journal_volume>' . PHP_EOL;
$xml .= '<issue>' . $stage_info['stage_no'] . '</issue>' . PHP_EOL;
$xml .= '</journal_issue>' . PHP_EOL;
$xml .= '<journal_article>' . PHP_EOL;
$xml .= '<titles>' . PHP_EOL;
$xml .= '<title>' . $article_info['title'] . '</title>' . PHP_EOL;
$xml .= '<subtitle></subtitle>' . PHP_EOL;
$xml .= '</titles>' . PHP_EOL;
$xml .= '<contributors>' . PHP_EOL;
$xml .= '<contributors>' . PHP_EOL;
$authors = $this->article_author_obj->where('article_id', $data['article_id'])->where('state', 0)->select();
$address = '';
$author = '';
foreach ($authors as $v) {
if ($v['is_first'] == 1) {
$ca = $this->author_to_organ_obj->where('article_author_id', $v['article_author_id'])->where('article_id', $data['article_id'])->find();
$ca_organ = $this->article_organ_obj->where('article_organ_id', $ca['article_organ_id'])->find();
$address = $ca_organ['organ_name'];
}
$author .= $v['author_name'] . ',';
}
$xml .= '<person_name sequence="first" contributor_role="author">' . substr($author, -1) . '</person_name>' . PHP_EOL;
$xml .= '<organization sequence="first" contributor_role="author">' . $address . '</organization>' . PHP_EOL;
$xml .= '</contributors>' . PHP_EOL;
$xml .= '<keywords></keywords>' . PHP_EOL;
$xml .= '<keywords>' . str_replace(',', ' ', $article_info['keywords']) . '</keywords>' . PHP_EOL;
$xml .= '<abstract></abstract>' . PHP_EOL;
$xml .= '<abstract>' . str_replace('Abstract', '', strip_tags(str_replace("&nbsp;", "", htmlspecialchars_decode($article_info['abstract'])))) . '</abstract>' . PHP_EOL;
$xml .= '<doi_data>' . PHP_EOL;
$xml .= '<doi>' . $article_info['doi'] . '</doi>' . PHP_EOL;
$xml .= '<resource><![CDATA[https://www.tmrjournals.com/article.html?J_num=' . $journal_info['journal_id'] . '&a_id=' . $article_info['article_id'] . ']]></resource>' . PHP_EOL;
$xml .= '</doi_data>' . PHP_EOL;
$xml .= '<pages>' . PHP_EOL;
$start = '';
$end = '';
if (stripos($article_info['npp'], '-') > 0) {
$ca_list = explode('-', $article_info['npp']);
$start = $ca_list[0];
$end = $ca_list[1];
} else {
$start = $article_info['npp'];
}
$xml .= '<first_page>' . $start . '</first_page>' . PHP_EOL;
$xml .= '<last_page>' . $end . '</last_page>' . PHP_EOL;
$xml .= '</pages>' . PHP_EOL;
$xml .= '</journal_article>' . PHP_EOL;
$txt = ROOT_PATH . 'public' . DS . 'xml' . DS . $article_info['article_id'] . '.xml';
file_put_contents($txt, $xml);
}
// public function upXML() {
// vendor("chinadoi.UPXML2");
// $up_obj = new \UpXml;
// $xmlfile = ROOT_PATH . 'public' . DS . 'xml' . DS . '1333.xml';
// $result = $up_obj->upload($xmlfile);
// echo '<pre>';
// var_dump($result);
// echo '</pre>';
// die;
// }
}