1
This commit is contained in:
@@ -52,5 +52,31 @@ class Web extends Base
|
||||
$re['articles'] = $list;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
public function getRefers(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"w_article_id"=>"require",
|
||||
"doi"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$production_info = $this->production_article_obj->where('w_article_id',$data['w_article_id'])->find();
|
||||
if (!$production_info){//一次验证,如果w_article_id获取失败
|
||||
$production_info = $this->production_article_obj->where('doi',$data['doi'])->where('state',0)->find();
|
||||
}
|
||||
|
||||
if(!$production_info){//如果两次获取都失败
|
||||
$refers = [];
|
||||
return jsonSuccess(['refer'=>$refers]);
|
||||
}
|
||||
|
||||
$list = $this->production_article_refer_obj->where('p_article_id',$production_info['p_article_id'])->where('state',0)->order('index')->select();
|
||||
$re['refers'] = $list;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user