feat(后台工资管理): 部分发放完善

master
yin5th 2023-01-14 11:42:10 +08:00
parent f4f6f431ac
commit 029d552abc
1 changed files with 10 additions and 2 deletions

View File

@ -276,11 +276,19 @@ class Pay extends Base
if ($total > 0) {
$res['list'] = $query->field('pml.id,sum(pml.amount) as amount,sum(pml.base_amount) as base_amount,pml.status,pml.year,pml.month,
sum(pml.overtime_amount) as overtime_amount,pml.account_id,pml.time,a.nickname,a.real_name,a.mobile,w.name as worksite_name,
sum(pml.overtime_amount) as overtime_amount,sum(pml.paid_amount) as paid_amount,pml.account_id,pml.time,a.nickname,a.real_name,a.mobile,w.name as worksite_name,
p.name as position_text,pml.paid_amount')
->page($page, $size)->order('pml.time', 'desc')->order('pml.id', 'desc')->select();
$res['list']->each(function ($item) {
$item->status_text = PayMonthLog::statusText()[$item->status] ?? '';
$item->status_text = '待发放';
if ($item['amount'] == $item['paid_amount'] && $item['amount'] > 0) {
$item->status_text = '完全发放';
}
if ($item['amount'] > $item['paid_amount'] && $item['paid_amount'] > 0) {
$item->status_text = '部分发放';
}
$item->time_text = $item->year.'年'.$item->month.'月';
});
}