56 lines
1.6 KiB
PHP
56 lines
1.6 KiB
PHP
<?php
|
|
namespace app\api\controller;
|
|
|
|
use app\api\controller\Base;
|
|
use think\Db;
|
|
use think\Queue;
|
|
use think\Validate;
|
|
|
|
class Web extends Base
|
|
{
|
|
|
|
private $Base_url = "http://journalapi.tmrjournals.com/public/index.php/";
|
|
public function __construct(\think\Request $request = null)
|
|
{
|
|
parent::__construct($request);
|
|
}
|
|
|
|
public function getStages(){
|
|
$data = $this->request->post();
|
|
$rule = new Validate([
|
|
"journal_id" => 'require'
|
|
]);
|
|
if(!$rule->check($data)){
|
|
return jsonError($rule->getError());
|
|
}
|
|
$journal_info = $this->journal_obj->where('journal_id',$data['journal_id'])->find();
|
|
|
|
//发送请求到官网
|
|
$url = $this->Base_url."master/Submision/getJournalStages";
|
|
$program['issn'] = $journal_info['issn'];
|
|
$res = object_to_array(json_decode(myPost($url,$program)));
|
|
$list = $res['data']['stages'];
|
|
$re['stages'] = $list;
|
|
return jsonSuccess($re);
|
|
}
|
|
|
|
/**获取分期文章列表
|
|
* @return \think\response\Json|void
|
|
*/
|
|
public function getArticlesByStage(){
|
|
$data = $this->request->post();
|
|
$rule = new Validate([
|
|
"journal_stage_id"=>"require"
|
|
]);
|
|
if(!$rule->check($data)){
|
|
return jsonError($rule->getError());
|
|
}
|
|
$url = $this->Base_url."master/Submision/getArticlesByStage";
|
|
$program['journal_stage_id'] = $data['journal_stage_id'];
|
|
$res = object_to_array(json_decode(myPost($url,$program)));
|
|
$list = $res['data']['articles'];
|
|
$re['articles'] = $list;
|
|
return jsonSuccess($re);
|
|
}
|
|
}
|
|
?>
|