1
This commit is contained in:
@@ -190,6 +190,23 @@ class Article extends Controller {
|
||||
|
||||
|
||||
|
||||
public function getArticleDetailHtmlFor2(){
|
||||
$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();
|
||||
if($article_info['html_type']!=2){
|
||||
return jsonError("type error");
|
||||
}
|
||||
$re['mains'] = getArticleMainsFor2($data['article_id']);
|
||||
$re['refers'] = getArticleRefers($data['article_id']);
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getArticleDetailCites(){
|
||||
|
||||
@@ -204,8 +204,14 @@ function pCrossrefCite($article_id){
|
||||
|
||||
function hasHtml($article_id){
|
||||
$article_main_obj = Db::name("article_main");
|
||||
$article_obj = Db::name("article");
|
||||
$article_info = $article_obj->where("article_id",$article_id)->find();
|
||||
$list = $article_main_obj->where('article_id', $article_id)->where('state', 0)->where('is_add', 0)->find();
|
||||
return $list?1:0;
|
||||
if($article_info['file_html']!=""||$article_info['html_type']==2||$list){
|
||||
return 1;
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function getArticleRefers($article_id)
|
||||
@@ -221,6 +227,17 @@ function getArticleRefers($article_id)
|
||||
return $refers;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getArticleMainsFor2($article_id){
|
||||
$url = "http://api.tmrjournals.com/public/index.php/api/Web/getArticleMainsForJournal";
|
||||
$program['article_id'] = $article_id;
|
||||
$res = object_to_array(json_decode(myPost($url, $program)));
|
||||
$refers = isset($res['data']['refers']) ? $res['data']['refers'] : [];
|
||||
return $refers;
|
||||
}
|
||||
|
||||
|
||||
function getArticleTracks($doi)
|
||||
{
|
||||
$url = "http://api.tmrjournals.com/public/index.php/api/Web/getStackByDoi";
|
||||
|
||||
@@ -492,6 +492,7 @@ class Article extends Controller
|
||||
$insert['file_pdf'] = date('Ymd') . DS . $file_name;
|
||||
$insert['mhoo'] = $data['mhoo'];
|
||||
$insert['is_public'] = 1;
|
||||
$insert['html_type']=2;
|
||||
$insert['ctime'] = time();
|
||||
Db::startTrans();
|
||||
$aid = $this->article_obj->insertGetId($insert);
|
||||
|
||||
Reference in New Issue
Block a user