Compare commits
2 Commits
a80897644e
...
f9e29ad876
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9e29ad876 | ||
|
|
875d486ab5 |
@@ -260,22 +260,24 @@ class Production extends Base
|
||||
*/
|
||||
public function getProductionMains()
|
||||
{
|
||||
die("stop service!");
|
||||
// $data = $this->request->post();
|
||||
// $rule = new Validate([
|
||||
// "p_article_id" => "require"
|
||||
// ]);
|
||||
// if (!$rule->check($data)) {
|
||||
// return jsonError($rule->getError());
|
||||
// }
|
||||
// $p_info = $this->production_article_obj->where('p_article_id', $data['p_article_id'])->find();
|
||||
// die("stop service!");
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"p_article_id" => "require"
|
||||
]);
|
||||
if (!$rule->check($data)) {
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$p_info = $this->production_article_obj->where('p_article_id', $data['p_article_id'])->find();
|
||||
$frag = getArticleMains($p_info['article_id']);
|
||||
|
||||
// $frag = $this->getProductionMainImgs($data['p_article_id']);
|
||||
// if (count($frag) == 0) {
|
||||
// return jsonError("create error");
|
||||
// }
|
||||
// $re['mains'] = $frag;
|
||||
// $re['production'] = $p_info;
|
||||
// return jsonSuccess($re);
|
||||
$re['mains'] = $frag;
|
||||
$re['production'] = $p_info;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -815,6 +817,7 @@ class Production extends Base
|
||||
$pra['authors'] = json_encode($authors);
|
||||
$pra['organs'] = json_encode($organs);
|
||||
$res = object_to_array(json_decode(myPost($url, $pra)));
|
||||
|
||||
if ($res['code'] == 0) {
|
||||
$r_update['state'] = 2;
|
||||
$r_update['w_article_id'] = isset($res['data']['article_id']) ? $res['data']['article_id'] : 0;
|
||||
|
||||
@@ -199,48 +199,48 @@ class Typeset extends Base
|
||||
/**
|
||||
* 推送文章到官网系统
|
||||
*/
|
||||
public function pushArticleToSystem(){
|
||||
die('Service suspension!');
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
'on_id'=>'require'
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$on_info = $this->online_obj->where('on_id',$data['on_id'])->find();
|
||||
$ts_info = $this->ts_obj->where('article_id',$on_info['article_id'])->where('ts_state',0)->find();
|
||||
$article_info = $this->article_obj->where('article_id',$on_info['article_id'])->find();
|
||||
$journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
|
||||
$authors = $this->article_author_obj->where('article_id',$article_info['article_id'])->where('state',0)->select();
|
||||
//check信息是否完整
|
||||
if($on_info['journal_stage_id']==''||$on_info['on_doi']==''||$on_info['abstract']==''||$on_info['npp']==''){
|
||||
return jsonError('信息不全!');
|
||||
}
|
||||
//发送推送请求
|
||||
// $url = "http://www.journal.com/master/Article/addArticleForSubmission";
|
||||
$url = 'http://journalapi.tmrjournals.com/public/index.php/master/Article/addArticleForSubmission';
|
||||
$pra = [];
|
||||
$pra['title'] = $ts_info['ts_title'];
|
||||
$pra['journal_stage_id'] = $on_info['journal_stage_id'];
|
||||
$pra['issn'] = $journal_info['issn'];
|
||||
$pra['type'] = translateType($article_info['type']);
|
||||
$pra['doi'] = $on_info['on_doi'];
|
||||
$pra['abstract'] = $on_info['abstract'];
|
||||
$pra['pub_date'] = $ts_info['online_date'];
|
||||
$pra['file_pdf'] = $article_info['pdf_url'];
|
||||
$pra['keywords'] = $ts_info['keywords'];
|
||||
$pra['npp'] = $on_info['npp'];
|
||||
$pra['authors'] = json_encode($authors);
|
||||
|
||||
$res = object_to_array(json_decode(myPost($url, $pra)));
|
||||
if($res['code']==0){
|
||||
$this->online_obj->where('on_id',$data['on_id'])->update(['has_push'=>1]);
|
||||
return jsonSuccess([]);
|
||||
}else{
|
||||
return jsonError('system error:'.$res['msg']);
|
||||
}
|
||||
}
|
||||
// public function pushArticleToSystem(){
|
||||
// die('Service suspension!');
|
||||
// $data = $this->request->post();
|
||||
// $rule = new Validate([
|
||||
// 'on_id'=>'require'
|
||||
// ]);
|
||||
// if(!$rule->check($data)){
|
||||
// return jsonError($rule->getError());
|
||||
// }
|
||||
// $on_info = $this->online_obj->where('on_id',$data['on_id'])->find();
|
||||
// $ts_info = $this->ts_obj->where('article_id',$on_info['article_id'])->where('ts_state',0)->find();
|
||||
// $article_info = $this->article_obj->where('article_id',$on_info['article_id'])->find();
|
||||
// $journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
|
||||
// $authors = $this->article_author_obj->where('article_id',$article_info['article_id'])->where('state',0)->select();
|
||||
// //check信息是否完整
|
||||
// if($on_info['journal_stage_id']==''||$on_info['on_doi']==''||$on_info['abstract']==''||$on_info['npp']==''){
|
||||
// return jsonError('信息不全!');
|
||||
// }
|
||||
// //发送推送请求
|
||||
// // $url = "http://www.journal.com/master/Article/addArticleForSubmission";
|
||||
// $url = 'http://journalapi.tmrjournals.com/public/index.php/master/Article/addArticleForSubmission';
|
||||
// $pra = [];
|
||||
// $pra['title'] = $ts_info['ts_title'];
|
||||
// $pra['journal_stage_id'] = $on_info['journal_stage_id'];
|
||||
// $pra['issn'] = $journal_info['issn'];
|
||||
// $pra['type'] = translateType($article_info['type']);
|
||||
// $pra['doi'] = $on_info['on_doi'];
|
||||
// $pra['abstract'] = $on_info['abstract'];
|
||||
// $pra['pub_date'] = $ts_info['online_date'];
|
||||
// $pra['file_pdf'] = $article_info['pdf_url'];
|
||||
// $pra['keywords'] = $ts_info['keywords'];
|
||||
// $pra['npp'] = $on_info['npp'];
|
||||
// $pra['authors'] = json_encode($authors);
|
||||
//
|
||||
// $res = object_to_array(json_decode(myPost($url, $pra)));
|
||||
// if($res['code']==0){
|
||||
// $this->online_obj->where('on_id',$data['on_id'])->update(['has_push'=>1]);
|
||||
// return jsonSuccess([]);
|
||||
// }else{
|
||||
// return jsonError('system error:'.$res['msg']);
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 编辑online信息
|
||||
|
||||
Reference in New Issue
Block a user