fix: 审批人卡单数仅统计在途流程 #973
@ -135,6 +135,7 @@ class ShopInfoFlowMirrorRepository
|
||||
->leftJoin($flow . ' as o', 'o.flowId', '=', 'f.flowId')
|
||||
->whereNotNull('o.approver')
|
||||
->where('o.approver', '!=', '')
|
||||
->whereIn('o.flowStatus', [1, 7])
|
||||
->selectRaw('o.approver, COUNT(*) AS total')
|
||||
->groupBy('o.approver');
|
||||
$this->applyFilters($query, $filters);
|
||||
|
||||
@ -167,6 +167,25 @@ class ShopInfoFlowMirrorRepositoryTest extends TestCase
|
||||
'updateTime' => '2026-10-05 10:00:00',
|
||||
]);
|
||||
}
|
||||
$this->insertApplication(
|
||||
13,
|
||||
'approver-finished',
|
||||
10,
|
||||
'京东',
|
||||
'历史审批人测试',
|
||||
'ERP-历史审批人测试',
|
||||
'申请人13',
|
||||
'2026-10-05 09:00:00',
|
||||
);
|
||||
$db->table('oa_flow_flow')->insert([
|
||||
'Id' => 13,
|
||||
'flowId' => 'approver-finished',
|
||||
'flowType' => 10,
|
||||
'flowStatus' => 3,
|
||||
'subject' => '[店铺关店-历史审批人测试]',
|
||||
'approver' => '历史审批人',
|
||||
'updateTime' => '2026-10-05 10:00:00',
|
||||
]);
|
||||
|
||||
$options = $this->repository->currentApproverOptions([
|
||||
'flow_type' => ['店铺关店'],
|
||||
@ -178,6 +197,7 @@ class ShopInfoFlowMirrorRepositoryTest extends TestCase
|
||||
'玉兔' => 1,
|
||||
'常仪' => 1,
|
||||
], array_column($options, 'count', 'value'));
|
||||
$this->assertArrayNotHasKey('历史审批人', array_column($options, 'count', 'value'));
|
||||
$this->assertSame([['value' => '审核人A', 'count' => 1]], $this->repository->currentApproverOptions([
|
||||
'flow_type' => ['店铺变更'],
|
||||
]));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user