Merge remote-tracking branch 'origin/master'

This commit is contained in:
wangjinlei
2025-11-25 14:28:15 +08:00
2 changed files with 45 additions and 24 deletions

View File

@@ -1713,23 +1713,30 @@ return null;
}
//查询参考文献数据
$aWhere = ['p_article_id' => $iPArticleId,'article_id' => $iArticleId,'state' => 0];
$iCount = Db::name('production_article_refer')->where($aWhere)->count();
if(empty($iCount)){
$aRefer = Db::name('production_article_refer')->where($aWhere)->select();
if(empty($aRefer)){
return json_encode(array('status' => 3,'msg' => 'Reference is empty','data' => ['total' => 0,'unprocessed_total' => 0,'processed_total' => 0]));
}
//获取未处理的数据
$aWhere['is_deal'] = 2;
$aUnprocessed = Db::name('production_article_refer')->where($aWhere)->select();
//获取已处理的数据
$aWhere['is_deal'] = 1;
$aProcessed = Db::name('production_article_refer')->where($aWhere)->select();
//未处理的数量
$iUnprocessed = empty($aUnprocessed) ? 0 : count($aUnprocessed);
//已处理的数量
$iProcessed = empty($aProcessed) ? 0 : count($aProcessed);
//数据组合
$aRefer = array_merge($aUnprocessed,$aProcessed);
//获取总数量
$iCount = empty($aRefer) ? 0 : count($aRefer);
$aWhere["refer_doi"] = ["<>",""];
$aDoi = Db::name('production_article_refer')->field('count(p_article_id) as num,refer_doi')->where($aWhere)->group('refer_doi')->select();
$aDoi = empty($aDoi) ? [] : array_column($aDoi, 'num','refer_doi');
//数据处理
$iUnprocessed = $iProcessed = 0;
foreach ($aRefer as $key => $value) {
if($value['is_deal'] == 1){
$iProcessed++;
}
if($value['is_deal'] == 2){
$iUnprocessed++;
}
$iIsRepat = 0;
if(!empty($value['refer_doi']) && (!empty($aDoi[$value['refer_doi']]) && $aDoi[$value['refer_doi']] > 1)){
$iIsRepat = 1;
}
$aRefer[$key]['is_repeat'] = $iIsRepat;
}
$aRefer = ['total' => $iCount,'unprocessed_total' => $iUnprocessed,'processed_total' => $iProcessed,'refer' => $aRefer];
return json_encode(['status' => 1,'msg' => 'success','data' => $aRefer]);
}
@@ -1749,10 +1756,10 @@ return null;
if(empty($aArticle)){
return jsonError('No article information found');
}
$iIsBuy = empty($aArticle['is_buy']) ? 0 : $aArticle['is_buy'];
if($iIsBuy != 1){
return jsonError('Article unpaid');
}
// $iIsBuy = empty($aArticle['is_buy']) ? 0 : $aArticle['is_buy'];
// if($iIsBuy != 1){
// return jsonError('Article unpaid');
// }
$aWhere = ['article_id' => $iArticleId,'state' => 0];
$aProductionArticle = $this->production_article_obj->field('p_article_id')->where($aWhere)->find();
if(!empty($aProductionArticle)) {