更新用户打款

This commit is contained in:
yaooo 2023-11-03 16:20:42 +08:00
parent 0cd326553b
commit 8f8be7f559
1 changed files with 11 additions and 1 deletions

View File

@ -535,11 +535,21 @@ class FinanceExpense extends ApiController
if($auth == 0){
$this->apiError('你没有打款权限请联系管理员或者HR');
}
$expense = (new ExpenseList())->detail($param['id'] ?? 0);
if (empty($expense)) {
$this->apiError('报销流程不存在');
}
if ($expense['check_status'] == 5) {
$this->apiError('该报销已打款');
}
if ($expense['check_status'] != 2) {
$this->apiError('该报销流程审核未通过');
}
$param['check_status'] = 5;
$param['pay_admin_id'] = $this->uid;
$param['pay_time'] = time();
$res = ExpenseList::where('id', $param['id'])->strict(false)->field(true)->update($param);
if ($res !== false) {
if ($res) {
add_log('topay', $param['id'],$param,'报销');
$detail = ExpenseList::where(['id' => $param['id']])->find();
$msg = [