Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -4441,4 +4441,54 @@ class Production extends Base
|
||||
Db::commit();
|
||||
return json_encode(array('status' => 1,'msg' => 'PDF generated successfully'));
|
||||
}
|
||||
/**
|
||||
* 获取排版生成PDF历史版本
|
||||
* @param p_article_id 文章ID
|
||||
*/
|
||||
public function getProductionArticlePdf($aParam = []){
|
||||
|
||||
//获取参数
|
||||
$aParam = empty($aParam) ? $this->request->post() : $aParam;
|
||||
|
||||
//必填值验证
|
||||
$iPArticleId = empty($aParam['p_article_id']) ? '' : $aParam['p_article_id'];
|
||||
if(empty($iPArticleId)){
|
||||
return json_encode(array('status' => 2,'msg' => 'Please select an article' ));
|
||||
}
|
||||
|
||||
//查询文章
|
||||
$aWhere = ['p_article_id' => $iPArticleId,'state' => ['in',[0,2]]];
|
||||
$aProductionArticle = Db::name('production_article')->field('article_id,pdf_id')->where($aWhere)->find();
|
||||
if(empty($aProductionArticle)){
|
||||
return json_encode(array('status' => 3,'msg' => 'No articles found' ));
|
||||
}
|
||||
$iArticleId = empty($aProductionArticle['article_id']) ? 0 : $aProductionArticle['article_id'];
|
||||
if(empty($iArticleId)){
|
||||
return json_encode(array('status' => 4,'msg' => 'Unbound article' ));
|
||||
}
|
||||
//日志查询
|
||||
$aWhere = ['article_id' => $iArticleId,'p_article_id' => $iPArticleId,'state' => 2];
|
||||
$aPdf = Db::name('production_article_pdf')->field('pdf_id,url,create_time')->where($aWhere)->select();
|
||||
return json_encode(array('status' => 1,'msg' => 'success','data' => $aPdf));
|
||||
}
|
||||
/**
|
||||
* 获取生产文章信息
|
||||
* @param p_article_id 文章ID
|
||||
*/
|
||||
public function getProductionArticle($aParam = []){
|
||||
|
||||
//获取参数
|
||||
$aParam = empty($aParam) ? $this->request->post() : $aParam;
|
||||
|
||||
//必填值验证
|
||||
$iPArticleId = empty($aParam['p_article_id']) ? '' : $aParam['p_article_id'];
|
||||
if(empty($iPArticleId)){
|
||||
return json_encode(array('status' => 2,'msg' => 'Please select an article' ));
|
||||
}
|
||||
|
||||
//查询文章
|
||||
$aWhere = ['p_article_id' => $iPArticleId,'state' => ['in',[0,2]]];
|
||||
$aProductionArticle = Db::name('production_article')->field('pdf_id,file_sub_table')->where($aWhere)->find();
|
||||
return json_encode(array('status' => 1,'msg' => 'success','data' => $aPdf));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,6 +105,7 @@ page={{stage_page}},%号
|
||||
}
|
||||
}
|
||||
//子刊信息
|
||||
$aJournalStage = [];
|
||||
$iJournalStageId = empty($aProductionArticle['journal_stage_id']) ? 0 : $aProductionArticle['journal_stage_id'];
|
||||
if(!empty($iJournalStageId)){
|
||||
$aJournalStage = $this->getJournalStage(['journal_stage_id' => $iJournalStageId]);
|
||||
@@ -321,7 +322,7 @@ page={{stage_page}},%号
|
||||
// }
|
||||
//下载图片
|
||||
$sImagePath = trim($this->sSubmissionUrl,'/').$this->sArticleMainImage.'/'.$aImageInfo['url'];
|
||||
$aResult = $this->getImage($sImagePath,$aProductionArticle['p_article_id']);
|
||||
$aResult = $this->getImage($sImagePath,$aProductionArticle['article_id']);
|
||||
if(empty($aResult['data'])){
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user