审批文章稿费补丁

This commit is contained in:
wangjinlei
2026-07-14 13:39:29 +08:00
parent 4cf26ea682
commit 296294d405

View File

@@ -240,6 +240,54 @@ class Order extends base{
return jsonSuccess($re);
}
public function getApplyArticleList(){
$data = $this->request->post();
$rule = new Validate([
"state"=>"require",
"pageIndex"=>"require",
"pageSize"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$start_page = ($data['pageIndex']-1)*$data['pageSize'];
$sql = "SELECT a.article_id,a.title,a.accept_sn,j.title journal_title FROM t_article a
INNER JOIN (
SELECT MAX(id) AS max_id, article_id
FROM t_article_price_apply
GROUP BY article_id
) t ON a.article_id = t.article_id
INNER JOIN t_article_price_apply apa ON apa.id = t.max_id
LEFT JOIN t_journal j ON a.journal_id = j.journal_id
WHERE apa.state = ".$data['state']."
LIMIT ".$start_page.",".$data['pageSize'];
$row = Db::query($sql);
foreach ($row as $k=>$v){
$row[$k]['history'] = Db::name("article_price_apply")->where("article_id",$v['article_id'])->select();
}
$countSql = "SELECT COUNT(*) AS total FROM t_article a
INNER JOIN (
SELECT MAX(id) AS max_id, article_id
FROM t_article_price_apply
GROUP BY article_id
) t ON a.article_id = t.article_id
INNER JOIN t_article_price_apply apa ON apa.id = t.max_id
WHERE apa.state = ".$data['state'];
$total = Db::query($countSql);
$total = intval($total[0]['total'] ?? 0);
$re['list'] = $row;
$re['count'] = $total;
return jsonSuccess($re);
}
public function getApplyCount(){
$res = Db::name("article_price_apply")->field("state,count(*) as count")->group("state")->select();