diff --git a/app/api/controller/FinanceExpense.php b/app/api/controller/FinanceExpense.php index 1594324..8f2fc7f 100644 --- a/app/api/controller/FinanceExpense.php +++ b/app/api/controller/FinanceExpense.php @@ -506,7 +506,7 @@ class FinanceExpense extends ApiController $this->uid = JWT_UID; $auth = isAuthExpense($this->uid); if($auth == 0){ - $this->apiError('没有权限'); + $this->apiError('你没有权限,请联系管理员或者HR'); } $param = get_params(); $where = []; @@ -526,4 +526,33 @@ class FinanceExpense extends ApiController $this->apiSuccess($list); } + //报销设置为已打款 + public function topay() + { + $param = get_params(); + $this->uid = JWT_UID; + $auth = isAuthExpense($this->uid); + if($auth == 0){ + $this->apiError('你没有打款权限,请联系管理员或者HR'); + } + $param['check_status'] = 5; + $param['pay_admin_id'] = $this->uid; + $param['pay_time'] = time(); + $res = Expense::where('id', $param['id'])->strict(false)->field(true)->update($param); + if ($res !== false) { + add_log('topay', $param['id'],$param,'报销'); + $detail = Expense::where(['id' => $param['id']])->find(); + $msg=[ + 'create_time'=>$detail['create_time'], + 'title'=>'报销', + 'action_id'=>$detail['id'] + ]; + $users = $detail['admin_id']; + sendMessage($users, 34, $msg); + $this->apiSuccess('操作成功'); + } else { + $this->apiError('操作失败'); + } + } + }