This commit is contained in:
wangjinlei
2024-11-13 16:10:14 +08:00
parent ef91e9de61
commit 11560a503c
4 changed files with 108 additions and 47 deletions

View File

@@ -587,22 +587,25 @@ class Production extends Base
}
$this->refuseReferIndex($data['p_article_id']);
$list = $this->production_article_refer_obj
->field("*,
CASE
WHEN refer_doi != ''
AND refer_doi IS NOT NULL
AND refer_doi IN (
SELECT refer_doi
FROM t_production_article_refer
WHERE p_article_id = ".$data['p_article_id']."
AND state = 0
GROUP BY refer_doi
HAVING COUNT(*) > 1
) THEN 1
ELSE 0
END AS repeat
")
// ->field("*,
// CASE
// WHEN refer_doi != ''
// AND refer_doi IS NOT NULL
// AND refer_doi IN (
// SELECT refer_doi
// FROM t_production_article_refer
// WHERE p_article_id = ".$data['p_article_id']."
// AND state = 0
// GROUP BY refer_doi
// HAVING COUNT(*) > 1
// ) THEN 1
// ELSE 0
// END AS repeat
// ")
->where('p_article_id', $data['p_article_id'])->where('state', 0)->order("index")->select();
// echo $this->production_article_refer_obj->getLastSql();
$re['refers'] = $list;
return jsonSuccess($re);
}