20201112
This commit is contained in:
@@ -160,6 +160,9 @@ class Article extends Controller {
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||
|
||||
$list[$k]['topic'] = $cache_topic;
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
}
|
||||
@@ -227,6 +230,9 @@ class Article extends Controller {
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||
|
||||
$list[$k]['topic'] = $cache_topic;
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
}
|
||||
@@ -258,6 +264,7 @@ class Article extends Controller {
|
||||
*/
|
||||
public function addArticleNum(){
|
||||
$data = $this->request->post();
|
||||
|
||||
$this->article_obj->where('article_id',$data['article_id'])->setInc($data['type'].'_num');
|
||||
$article_info = $this->article_obj->where('article_id',$data['article_id'])->find();
|
||||
|
||||
@@ -330,6 +337,9 @@ class Article extends Controller {
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||
|
||||
$list[$k]['topic'] = $cache_topic;
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
}
|
||||
|
||||
@@ -233,6 +233,9 @@ class Journal extends Controller {
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||
|
||||
$list[$k]['topic'] = $cache_topic;
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
}
|
||||
@@ -287,8 +290,9 @@ class Journal extends Controller {
|
||||
} else {
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
}
|
||||
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||
|
||||
// $cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$list[$k]['topic'] = $cache_topic;
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
}
|
||||
@@ -355,6 +359,9 @@ class Journal extends Controller {
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||
|
||||
$list[$k]['topic'] = $cache_topic;
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
}
|
||||
@@ -392,6 +399,9 @@ class Journal extends Controller {
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||
|
||||
$list[$k]['topic'] = $cache_topic;
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
}
|
||||
@@ -448,6 +458,9 @@ class Journal extends Controller {
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||
|
||||
$list[$k]['topic'] = $cache_topic;
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
}
|
||||
@@ -531,6 +544,9 @@ class Journal extends Controller {
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||
|
||||
$list[$k]['topic'] = $cache_topic;
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
}
|
||||
@@ -703,7 +719,7 @@ class Journal extends Controller {
|
||||
*/
|
||||
public function getTopicForSubscribe() {
|
||||
$data = $this->request->post();
|
||||
$list = $this->journal_topic_obj->where('journal_id', $data['journal_id'])->where('state', 0)->where('level', 2)->select();
|
||||
$list = $this->journal_topic_obj->where('journal_id', $data['journal_id'])->where('state', 0)->where('is_final', 1)->select();
|
||||
|
||||
$re['topics'] = $list;
|
||||
return jsonSuccess($re);
|
||||
@@ -751,6 +767,57 @@ class Journal extends Controller {
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 添加期刊话题订阅(批量)
|
||||
* @description 添加期刊话题订阅(批量)
|
||||
* @author wangjinlei
|
||||
* @url /api/Journal/addSubscribeTopics
|
||||
* @method POST
|
||||
*
|
||||
* @param name:topic_ids type:string require:1 desc:期刊话题id(1,2,3,4)
|
||||
* @param name:email type:string require:1 desc:邮箱地址
|
||||
*/
|
||||
public function addSubscribeTopics() {
|
||||
$data = $this->request->post();
|
||||
// $topics = explode(',', $data['topic_ids']);
|
||||
$topics = $data['topic_ids'];
|
||||
$str = '';
|
||||
foreach ($topics as $k => $v) {
|
||||
//去重
|
||||
$repeat = $this->subscribe_topic_obj
|
||||
->where('topic_id', $v)
|
||||
->where('email', $data['email'])
|
||||
->where('state', 0)
|
||||
->find();
|
||||
if ($repeat) {
|
||||
continue;
|
||||
}
|
||||
$insert['topic_id'] = $v;
|
||||
$insert['email'] = $data['email'];
|
||||
$id = $this->subscribe_topic_obj->insertGetId($insert);
|
||||
$cache_info = $this->journal_topic_obj->where('journal_topic_id',$v)->find();
|
||||
$str .= '<a href="http://journalapi.tmrjournals.com/public/index.php/api/Journal/UnsubscribeTopic/snum/' . $id . '">Unsubscribe topic->'.$cache_info['title'].'</a><br>';
|
||||
}
|
||||
if($str==''){
|
||||
return jsonError('repeat subscribe!');
|
||||
}
|
||||
//发送邮件感谢
|
||||
$tt = 'Dear Researcher,<br><br>';
|
||||
$tt .= 'Welcome you to the email alert for the latest research and more. Thank you for your interest in our publications and topics.<br>';
|
||||
$tt .= $str;
|
||||
$tt .= 'This service is provided by TMR Publishing Group | New Zealand<br>';
|
||||
$tt .= 'Telephone: +64 02108293806';
|
||||
$tt .= 'Email: publisher@tmrjournals.com';
|
||||
$tt .= 'www.tmrjournals.com';
|
||||
$maidata['email'] = $data['email'];
|
||||
$maidata['title'] = 'Thank you for subscribing.';
|
||||
$maidata['content'] = $tt;
|
||||
$maidata['tmail'] = 'publicrelations@tmrjournals.com';
|
||||
$maidata['tpassword'] = 'pRWU999999';
|
||||
Queue::push('app\api\job\mail@fire', $maidata, "mail");
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 添加期刊话题订阅
|
||||
* @description 添加期刊话题订阅
|
||||
@@ -863,6 +930,9 @@ class Journal extends Controller {
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||
|
||||
$list[$k]['topic'] = $cache_topic;
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
|
||||
@@ -922,6 +992,9 @@ class Journal extends Controller {
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||
|
||||
$list[$k]['topic'] = $cache_topic;
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
//斜体变红
|
||||
@@ -978,7 +1051,7 @@ class Journal extends Controller {
|
||||
}
|
||||
//组装作者
|
||||
$arts = [];
|
||||
if(isset($data['author']) && $data['author'] != ''){
|
||||
if (isset($data['author']) && $data['author'] != '') {
|
||||
$arts = $this->article_author_obj->where('state', 0)->where('author_name', 'like', '%' . trim($data['author']) . '%')->column('article_id');
|
||||
if (count($arts) == 0) {
|
||||
$re['articles'] = [];
|
||||
@@ -986,7 +1059,7 @@ class Journal extends Controller {
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//构造查询语句
|
||||
$where_str = '';
|
||||
if (isset($data['term']) && $data['term'] != '') {
|
||||
@@ -1002,7 +1075,7 @@ class Journal extends Controller {
|
||||
$c_str = '(' . implode(',', $stages) . ')';
|
||||
$where_str = $where_str == '' ? 'journal_stage_id in ' . $c_str : 'journal_stage_id in ' . $c_str . ' and ' . $where_str;
|
||||
}
|
||||
|
||||
|
||||
if (count($arts) > 0) {
|
||||
$a_str = '(' . implode(',', $arts) . ')';
|
||||
$where_str = $where_str == '' ? 'article_id in ' . $a_str : 'article_id in ' . $a_str . ' and ' . $where_str;
|
||||
@@ -1043,7 +1116,7 @@ class Journal extends Controller {
|
||||
$re['count'] = $count;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @title 查找文章精确查找(新)
|
||||
* @description 查找文章精确查找(新)
|
||||
@@ -1063,54 +1136,54 @@ class Journal extends Controller {
|
||||
* @return articles:文章信息#
|
||||
* @return count:总数
|
||||
*/
|
||||
public function searchArticleMenu(){
|
||||
public function searchArticleMenu() {
|
||||
$data = $this->request->post();
|
||||
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
|
||||
|
||||
|
||||
//组合where语句
|
||||
$where_str = '';
|
||||
|
||||
if($data['key1'] == 'author'){
|
||||
|
||||
if ($data['key1'] == 'author') {
|
||||
$arts = $this->article_author_obj->where('state', 0)->where('author_name', 'like', '%' . trim($data['val1']) . '%')->column('article_id');
|
||||
$a_str = '(' . implode(',', $arts) . ')';
|
||||
$where_str = '(article_id in '. $a_str;
|
||||
}else{
|
||||
$where_str = '('.$data['key1'].' like "%'.$data['val1'].'%"';
|
||||
$where_str = '(article_id in ' . $a_str;
|
||||
} else {
|
||||
$where_str = '(' . $data['key1'] . ' like "%' . $data['val1'] . '%"';
|
||||
}
|
||||
if(isset($data['key2'])&&$data['key2']!=''){
|
||||
if($data['oper'] == 'and'){
|
||||
if (isset($data['key2']) && $data['key2'] != '') {
|
||||
if ($data['oper'] == 'and') {
|
||||
$where_str = $where_str . ' and ';
|
||||
}else{
|
||||
} else {
|
||||
$where_str = $where_str . ' or ';
|
||||
}
|
||||
if($data['key2'] == 'author'){
|
||||
if ($data['key2'] == 'author') {
|
||||
$arts = $this->article_author_obj->where('state', 0)->where('author_name', 'like', '%' . trim($data['val2']) . '%')->column('article_id');
|
||||
$a_str = '(' . implode(',', $arts) . ')';
|
||||
$where_str = $where_str.' article_id in '. $a_str;
|
||||
}else{
|
||||
$where_str = $where_str.' '.$data['key2'].' like "%'.$data['val2'].'%"';
|
||||
$where_str = $where_str . ' article_id in ' . $a_str;
|
||||
} else {
|
||||
$where_str = $where_str . ' ' . $data['key2'] . ' like "%' . $data['val2'] . '%"';
|
||||
}
|
||||
}
|
||||
//处理journal_id
|
||||
$where_str = $where_str . ') and journal_id in ('.trim($data['journal_id']).') and state = 0 ';
|
||||
$where_str = $where_str . ') and journal_id in (' . trim($data['journal_id']) . ') and state = 0 ';
|
||||
//处理order
|
||||
$order_str = '';
|
||||
if($data['key1']=='title'&&(isset($data['key2'])&&$data['key2']=='title')){
|
||||
if ($data['key1'] == 'title' && (isset($data['key2']) && $data['key2'] == 'title')) {
|
||||
$order_str = "((CASE WHEN title LIKE '%" . trim($data['val1']) . "%' THEN 1 ELSE 0 END) + (CASE WHEN title LIKE '%" . trim($data['val2']) . "%' THEN 1 ELSE 0 END)) desc";
|
||||
}elseif($data['key1']=='title'||(isset($data['key2'])&&$data['key2']=='title')){
|
||||
if($data['key1']=='title'){
|
||||
} elseif ($data['key1'] == 'title' || (isset($data['key2']) && $data['key2'] == 'title')) {
|
||||
if ($data['key1'] == 'title') {
|
||||
$order_str = "(CASE WHEN title LIKE '%" . trim($data['val1']) . "%' THEN 1 ELSE 0 END) desc";
|
||||
}else{
|
||||
} else {
|
||||
$order_str = "(CASE WHEN title LIKE '%" . trim($data['val2']) . "%' THEN 1 ELSE 0 END) desc";
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
$order_str = "article_id desc";
|
||||
}
|
||||
|
||||
|
||||
$list = $this->article_obj
|
||||
->where($where_str)
|
||||
->orderRaw($order_str)
|
||||
->limit($limit_start,$data['pageSize'])
|
||||
->limit($limit_start, $data['pageSize'])
|
||||
->select();
|
||||
$count = $this->article_obj
|
||||
->where($where_str)
|
||||
@@ -1124,6 +1197,9 @@ class Journal extends Controller {
|
||||
//组合cite信息
|
||||
$no = $stage_info['stage_no'] == 0 ? ':' : '(' . $stage_info['stage_no'] . '):';
|
||||
$cite = $v['abbr'] . '. ' . $v['title'] . '. <i>' . $journal_info['jabbr'] . '</i>. ' . $stage_info['stage_year'] . ';' . $stage_info['stage_vol'] . $no . $v['npp'] . '. doi:' . $v['doi'];
|
||||
$cache_topic = $this->article_to_topic_obj->field('j_journal_topic.*')->join('j_journal_topic','j_journal_topic.journal_topic_id = j_article_to_topic.topic_id','left')->where('j_article_to_topic.article_id',$v['article_id'])->where('j_article_to_topic.state',0)->select();
|
||||
|
||||
$list[$k]['topic'] = $cache_topic;
|
||||
$list[$k]['cite'] = $cite;
|
||||
$list[$k]['authortitle'] = $this->getAuthor($v);
|
||||
//斜体变红
|
||||
@@ -1132,10 +1208,10 @@ class Journal extends Controller {
|
||||
foreach ($caches as $val) {
|
||||
$cache_title = str_replace($val, '<i>' . $val . '</i>', $cache_title);
|
||||
}
|
||||
if ($data['key1']=='title') {
|
||||
if ($data['key1'] == 'title') {
|
||||
$cache_title = str_replace(trim($data['val1']), '<b style="color:#c00">' . $data['val1'] . '</b>', $cache_title);
|
||||
}
|
||||
if (isset($data['key2'])&&$data['key2']=='title') {
|
||||
if (isset($data['key2']) && $data['key2'] == 'title') {
|
||||
$cache_title = str_replace(trim($data['val2']), '<b style="color:#c00">' . $data['val2'] . '</b>', $cache_title);
|
||||
}
|
||||
$list[$k]['title'] = $cache_title;
|
||||
@@ -1144,7 +1220,6 @@ class Journal extends Controller {
|
||||
$re['articles'] = $list;
|
||||
$re['count'] = $count;
|
||||
return jsonSuccess($re);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -578,5 +578,6 @@ class Main extends Controller {
|
||||
// echo '</pre>';
|
||||
// die;
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,177 +1,213 @@
|
||||
<?php
|
||||
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use think\Db;
|
||||
//use TCPDF;
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: 流年 <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
// 应用公共文件
|
||||
function authcode($str) {
|
||||
$key = substr(md5('ThinkPHP.CN'), 5, 8);
|
||||
$str1 = substr(md5($str), 8, 10);
|
||||
return md5($key . $str1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @function sendEmail
|
||||
* @intro 发送邮件(带附件)
|
||||
* @param $email 接收邮箱
|
||||
* @param $title 邮件标题
|
||||
* @param $from_name 发件人
|
||||
* @param $content 邮件内容
|
||||
* @param $memail 邮件内容
|
||||
* @param $mpassword 邮件内容
|
||||
* @param $attachmentFile 附件 (string | array)
|
||||
* @return array
|
||||
*/
|
||||
function sendEmail($email = '', $title = '', $from_name = '', $content = '', $memail = '', $mpassword = '', $attachmentFile = '') {
|
||||
date_default_timezone_set('PRC');
|
||||
//Create a new PHPMailer instance
|
||||
$mail = new PHPMailer;
|
||||
//Tell PHPMailer to use SMTP
|
||||
$mail->isSMTP();
|
||||
//Enable SMTP debugging
|
||||
// 0 = off (for production use)
|
||||
// 1 = client messages
|
||||
// 2 = client and server messages
|
||||
$mail->SMTPDebug = 0;
|
||||
//Ask for HTML-friendly debug output
|
||||
$mail->Debugoutput = 'html';
|
||||
//charset
|
||||
$mail->CharSet = 'UTF-8';
|
||||
//Set the hostname of the mail server
|
||||
$mail->Host = "smtp.qiye.aliyun.com"; //请填写你的邮箱服务器
|
||||
//Set the SMTP port number - likely to be 25, 465 or 587
|
||||
$mail->Port = 25; //端口号
|
||||
//Whether to use SMTP authentication
|
||||
$mail->SMTPAuth = true;
|
||||
//Username to use for SMTP authentication
|
||||
$mail->Username = $memail == '' ? "tmrweb@tmrjournals.com" : $memail; //发件邮箱用户名
|
||||
//Password to use for SMTP authentication
|
||||
$mail->Password = $mpassword == '' ? "Wu999999tmrwe" : $mpassword; //发件邮箱密码
|
||||
//Set who the message is to be sent from
|
||||
$mail->setFrom($memail == '' ? "tmrweb@tmrjournals.com" : $memail, $from_name);
|
||||
//Set an alternative reply-to address(用户直接回复邮件的地址)
|
||||
$mail->addReplyTo($memail == '' ? "tmrweb@tmrjournals.com" : $memail, $from_name);
|
||||
//Set who the message is to be sent to
|
||||
$mail->addAddress($email);
|
||||
//Set the subject line
|
||||
$mail->Subject = $title;
|
||||
//Read an HTML message body from an external file, convert referenced images to embedded,
|
||||
//convert HTML into a basic plain-text alternative body
|
||||
$mail->msgHTML($content);
|
||||
//Replace the plain text body with one created manually
|
||||
$mail->AltBody = '';
|
||||
if (is_array($attachmentFile)) {
|
||||
for ($i = 0; $i < count($attachmentFile); $i++) {
|
||||
$mail->addAttachment($attachmentFile[$i], 'thanks.pdf' . $i); //这里可以是多维数组,然后循环附件的文件和名称
|
||||
}
|
||||
} else {
|
||||
if ($attachmentFile != '') {
|
||||
//Attach an image file
|
||||
$mail->addAttachment($attachmentFile, 'thanks.pdf');
|
||||
}
|
||||
}
|
||||
//send the message, check for errors
|
||||
if (!$mail->send()) {
|
||||
$status = 0;
|
||||
$data = "邮件发送失败" . $mail->ErrorInfo;
|
||||
;
|
||||
} else {
|
||||
$status = 1;
|
||||
$data = "邮件发送成功";
|
||||
}
|
||||
return ['status' => $status, 'data' => $data]; //返回值(可选)
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成文章sn号
|
||||
* @return type
|
||||
*/
|
||||
function getArticleSN($abbr,$type) {
|
||||
$str = $abbr;
|
||||
$str .= date('Y', time()).$type.date('md', time());
|
||||
$where['accept_sn'] = ['like', "$str%"];
|
||||
$nowres = Db::name('article')->where($where)->select();
|
||||
$last_num = 1;
|
||||
if ($nowres) {
|
||||
foreach ($nowres as $v) {
|
||||
$now_num = intval(substr($v['accept_sn'], -3));
|
||||
$last_num = $now_num > $last_num ? $now_num : $last_num;
|
||||
}
|
||||
$last_num += 1;
|
||||
}
|
||||
$last_str = sprintf("%03d", $last_num);
|
||||
$str .= $last_str;
|
||||
return $str;
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加usermsg
|
||||
*/
|
||||
function add_usermsg($userid, $content, $url) {
|
||||
$msg_obj = Db::name('user_msg');
|
||||
$msg_info = $msg_obj->where('user_id', $userid)
|
||||
->where('url', $url)
|
||||
->where('state', 0)
|
||||
->find();
|
||||
if ($msg_info) {
|
||||
return true;
|
||||
}
|
||||
$msgdata['user_id'] = $userid;
|
||||
$msgdata['content'] = $content;
|
||||
$msgdata['url'] = $url;
|
||||
$msgdata['ctime'] = time();
|
||||
return $msg_obj->insert($msgdata);
|
||||
}
|
||||
|
||||
function jsonSuccess($data){
|
||||
return json(['code'=>0,'msg'=>'success','data'=>$data]);
|
||||
}
|
||||
|
||||
function jsonError($msg){
|
||||
return json(['code'=>1,'msg'=>$msg]);
|
||||
}
|
||||
|
||||
function myPost($url, $param=array()){
|
||||
|
||||
if(!is_array($param)){
|
||||
|
||||
throw new Exception("参数必须为array");
|
||||
|
||||
}
|
||||
|
||||
$httph =curl_init($url);
|
||||
|
||||
// curl_setopt($httph, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
|
||||
// curl_setopt($httph, CURLOPT_SSL_VERIFYHOST, 1);
|
||||
|
||||
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);
|
||||
|
||||
// curl_setopt($httph, CURLOPT_RETURNTRANSFER,0);
|
||||
|
||||
// curl_setopt($httph, CURLOPT_HEADER,1);
|
||||
|
||||
$rst=curl_exec($httph);
|
||||
|
||||
curl_close($httph);
|
||||
|
||||
return $rst;
|
||||
|
||||
}
|
||||
|
||||
<?php
|
||||
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use think\Db;
|
||||
//use TCPDF;
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: 流年 <liu21st@gmail.com>
|
||||
// +----------------------------------------------------------------------
|
||||
// 应用公共文件
|
||||
function authcode($str) {
|
||||
$key = substr(md5('ThinkPHP.CN'), 5, 8);
|
||||
$str1 = substr(md5($str), 8, 10);
|
||||
return md5($key . $str1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @function sendEmail
|
||||
* @intro 发送邮件(带附件)
|
||||
* @param $email 接收邮箱
|
||||
* @param $title 邮件标题
|
||||
* @param $from_name 发件人
|
||||
* @param $content 邮件内容
|
||||
* @param $memail 邮件内容
|
||||
* @param $mpassword 邮件内容
|
||||
* @param $attachmentFile 附件 (string | array)
|
||||
* @return array
|
||||
*/
|
||||
function sendEmail($email = '', $title = '', $from_name = '', $content = '', $memail = '', $mpassword = '', $attachmentFile = '') {
|
||||
date_default_timezone_set('PRC');
|
||||
//Create a new PHPMailer instance
|
||||
$mail = new PHPMailer;
|
||||
//Tell PHPMailer to use SMTP
|
||||
$mail->isSMTP();
|
||||
//Enable SMTP debugging
|
||||
// 0 = off (for production use)
|
||||
// 1 = client messages
|
||||
// 2 = client and server messages
|
||||
$mail->SMTPDebug = 0;
|
||||
//Ask for HTML-friendly debug output
|
||||
$mail->Debugoutput = 'html';
|
||||
//charset
|
||||
$mail->CharSet = 'UTF-8';
|
||||
//Set the hostname of the mail server
|
||||
$mail->Host = "smtp.qiye.aliyun.com"; //请填写你的邮箱服务器
|
||||
//Set the SMTP port number - likely to be 25, 465 or 587
|
||||
$mail->Port = 25; //端口号
|
||||
//Whether to use SMTP authentication
|
||||
$mail->SMTPAuth = true;
|
||||
//Username to use for SMTP authentication
|
||||
$mail->Username = $memail == '' ? "tmrweb@tmrjournals.com" : $memail; //发件邮箱用户名
|
||||
//Password to use for SMTP authentication
|
||||
$mail->Password = $mpassword == '' ? "Wu999999tmrwe" : $mpassword; //发件邮箱密码
|
||||
//Set who the message is to be sent from
|
||||
$mail->setFrom($memail == '' ? "tmrweb@tmrjournals.com" : $memail, $from_name);
|
||||
//Set an alternative reply-to address(用户直接回复邮件的地址)
|
||||
$mail->addReplyTo($memail == '' ? "tmrweb@tmrjournals.com" : $memail, $from_name);
|
||||
//Set who the message is to be sent to
|
||||
$mail->addAddress($email);
|
||||
//Set the subject line
|
||||
$mail->Subject = $title;
|
||||
//Read an HTML message body from an external file, convert referenced images to embedded,
|
||||
//convert HTML into a basic plain-text alternative body
|
||||
$mail->msgHTML($content);
|
||||
//Replace the plain text body with one created manually
|
||||
$mail->AltBody = '';
|
||||
if (is_array($attachmentFile)) {
|
||||
for ($i = 0; $i < count($attachmentFile); $i++) {
|
||||
$mail->addAttachment($attachmentFile[$i], 'thanks.pdf' . $i); //这里可以是多维数组,然后循环附件的文件和名称
|
||||
}
|
||||
} else {
|
||||
if ($attachmentFile != '') {
|
||||
//Attach an image file
|
||||
$mail->addAttachment($attachmentFile, 'thanks.pdf');
|
||||
}
|
||||
}
|
||||
//send the message, check for errors
|
||||
if (!$mail->send()) {
|
||||
$status = 0;
|
||||
$data = "邮件发送失败" . $mail->ErrorInfo;
|
||||
;
|
||||
} else {
|
||||
$status = 1;
|
||||
$data = "邮件发送成功";
|
||||
}
|
||||
return ['status' => $status, 'data' => $data]; //返回值(可选)
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成文章sn号
|
||||
* @return type
|
||||
*/
|
||||
function getArticleSN($abbr,$type) {
|
||||
$str = $abbr;
|
||||
$str .= date('Y', time()).$type.date('md', time());
|
||||
$where['accept_sn'] = ['like', "$str%"];
|
||||
$nowres = Db::name('article')->where($where)->select();
|
||||
$last_num = 1;
|
||||
if ($nowres) {
|
||||
foreach ($nowres as $v) {
|
||||
$now_num = intval(substr($v['accept_sn'], -3));
|
||||
$last_num = $now_num > $last_num ? $now_num : $last_num;
|
||||
}
|
||||
$last_num += 1;
|
||||
}
|
||||
$last_str = sprintf("%03d", $last_num);
|
||||
$str .= $last_str;
|
||||
return $str;
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加usermsg
|
||||
*/
|
||||
function add_usermsg($userid, $content, $url) {
|
||||
$msg_obj = Db::name('user_msg');
|
||||
$msg_info = $msg_obj->where('user_id', $userid)
|
||||
->where('url', $url)
|
||||
->where('state', 0)
|
||||
->find();
|
||||
if ($msg_info) {
|
||||
return true;
|
||||
}
|
||||
$msgdata['user_id'] = $userid;
|
||||
$msgdata['content'] = $content;
|
||||
$msgdata['url'] = $url;
|
||||
$msgdata['ctime'] = time();
|
||||
return $msg_obj->insert($msgdata);
|
||||
}
|
||||
|
||||
function jsonSuccess($data){
|
||||
return json(['code'=>0,'msg'=>'success','data'=>$data]);
|
||||
}
|
||||
|
||||
function jsonError($msg){
|
||||
return json(['code'=>1,'msg'=>$msg]);
|
||||
}
|
||||
|
||||
function myPost($url, $param=array()){
|
||||
|
||||
if(!is_array($param)){
|
||||
|
||||
throw new Exception("参数必须为array");
|
||||
|
||||
}
|
||||
|
||||
$httph =curl_init($url);
|
||||
|
||||
// curl_setopt($httph, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
|
||||
// curl_setopt($httph, CURLOPT_SSL_VERIFYHOST, 1);
|
||||
|
||||
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);
|
||||
|
||||
// curl_setopt($httph, CURLOPT_RETURNTRANSFER,0);
|
||||
|
||||
// curl_setopt($httph, CURLOPT_HEADER,1);
|
||||
|
||||
$rst=curl_exec($httph);
|
||||
|
||||
curl_close($httph);
|
||||
|
||||
return $rst;
|
||||
|
||||
}
|
||||
|
||||
function ORCIDPost($url, $param=array()){
|
||||
|
||||
if(!is_array($param)){
|
||||
|
||||
throw new Exception("参数必须为array");
|
||||
|
||||
}
|
||||
$headerArray = ['Content-Type: application/x-www-form-urlencoded'];
|
||||
$httph =curl_init($url);
|
||||
|
||||
curl_setopt($httph, CURLOPT_SSL_VERIFYPEER, false);
|
||||
|
||||
// curl_setopt($httph, CURLOPT_SSL_VERIFYHOST, 1);
|
||||
|
||||
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);
|
||||
|
||||
curl_setopt($httph, CURLOPT_HTTPHEADER,$headerArray);
|
||||
|
||||
// curl_setopt($httph, CURLOPT_RETURNTRANSFER,0);
|
||||
|
||||
// curl_setopt($httph, CURLOPT_HEADER,1);
|
||||
|
||||
$rst=curl_exec($httph);
|
||||
|
||||
curl_close($httph);
|
||||
|
||||
return $rst;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -434,9 +434,6 @@ class Article extends Controller {
|
||||
* @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:abs_num type:int require:1 desc:简介数量
|
||||
* @param name:pdf_num type:int require:1 desc:pdf数量
|
||||
* @param name:html_num type:int require:1 desc:html数量
|
||||
* @param name:ltai type:string require:0 desc:标题斜体(demo1,demo2)
|
||||
* @param name:npp type:strng require:1 desc:文章页码
|
||||
* @param name:type type:string require:1 desc:类型
|
||||
@@ -462,9 +459,9 @@ class Article extends Controller {
|
||||
$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['abs_num'] = $data['abs_num'];
|
||||
// $updata['pdf_num'] = $data['pdf_num'];
|
||||
// $updata['html_num'] = $data['html_num'];
|
||||
$updata['npp'] = $data['npp'];
|
||||
$updata['type'] = $data['type'];
|
||||
$updata['cited'] = $data['cited'];
|
||||
@@ -1018,4 +1015,116 @@ class Article extends Controller {
|
||||
$re['cites'] = $list;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 注册doi
|
||||
* @description 注册doi
|
||||
* @author wangjinlei
|
||||
* @url /master/Article/agentDOI
|
||||
* @method POST
|
||||
*
|
||||
* @param name:doi type:string require:1 desc:doi号
|
||||
* @param name:article_id type:int require:1 desc:文章id
|
||||
*/
|
||||
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(" ","",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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user