From c9eb4f02c10b537e486d65085a4fa8f4b6a57f99 Mon Sep 17 00:00:00 2001 From: panliang <1163816051@qq.com> Date: Sat, 4 May 2024 19:11:19 +0800 Subject: [PATCH] service --- app/Admin/Services/AgreementService.php | 4 ++-- app/Admin/Services/EmployeePromotionService.php | 4 ++-- app/Admin/Services/EmployeeSignRepairService.php | 2 +- app/Admin/Services/HolidayApplyService.php | 2 +- app/Admin/Services/OfficalBusinessService.php | 2 +- app/Admin/Services/OvertimeApplyService.php | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Admin/Services/AgreementService.php b/app/Admin/Services/AgreementService.php index c4fc62a..33bff2d 100644 --- a/app/Admin/Services/AgreementService.php +++ b/app/Admin/Services/AgreementService.php @@ -47,10 +47,10 @@ class AgreementService extends BaseService if ($user->can('admin.agreement.view')) { array_push($actions, 'view'); } - if ($user->can('admin.agreement.update') && !in_array($model->workflow->check_status, [CheckStatus::Processing])) { + if ($user->can('admin.agreement.update') && !in_array($model->workflow->check_status, [CheckStatus::Processing, CheckStatus::Success])) { array_push($actions, 'edit'); } - if ($user->can('admin.agreement.delete') && !in_array($model->workflow->check_status, [CheckStatus::Processing])) { + if ($user->can('admin.agreement.delete') && !in_array($model->workflow->check_status, [CheckStatus::Processing, CheckStatus::Success])) { array_push($actions, 'delete'); } if ($user->can('admin.agreement.download') && in_array($model->workflow->check_status, [CheckStatus::Success])) { diff --git a/app/Admin/Services/EmployeePromotionService.php b/app/Admin/Services/EmployeePromotionService.php index ded82fa..0b2eb47 100644 --- a/app/Admin/Services/EmployeePromotionService.php +++ b/app/Admin/Services/EmployeePromotionService.php @@ -51,10 +51,10 @@ class EmployeePromotionService extends BaseService if ($user->can('admin.hr.promotion.view')) { array_push($actions, 'view'); } - if ($user->can('admin.hr.promotion.update') && !in_array($model->promotion_status, [PromotionStatus::Processing])) { + if ($user->can('admin.hr.promotion.update') && !in_array($model->promotion_status, [PromotionStatus::Processing, PromotionStatus::Success])) { array_push($actions, 'edit'); } - if ($user->can('admin.hr.promotion.delete') && !in_array($model->promotion_status, [PromotionStatus::Processing])) { + if ($user->can('admin.hr.promotion.delete') && !in_array($model->promotion_status, [PromotionStatus::Processing, PromotionStatus::Success])) { array_push($actions, 'delete'); } if (in_array($model->promotion_status, [PromotionStatus::Processing])) { diff --git a/app/Admin/Services/EmployeeSignRepairService.php b/app/Admin/Services/EmployeeSignRepairService.php index d96db13..42d7a00 100644 --- a/app/Admin/Services/EmployeeSignRepairService.php +++ b/app/Admin/Services/EmployeeSignRepairService.php @@ -47,7 +47,7 @@ class EmployeeSignRepairService extends BaseService if ($user->can('admin.hr.repairs.view')) { array_push($actions, 'view'); } - if ($user->can('admin.hr.repairs.delete') && !in_array($model->workflow->check_status, [CheckStatus::Processing])) { + if ($user->can('admin.hr.repairs.delete') && !in_array($model->workflow->check_status, [CheckStatus::Processing, CheckStatus::Success])) { array_push($actions, 'delete'); } if (in_array($model->workflow->check_status, [CheckStatus::None, CheckStatus::Cancel, CheckStatus::Fail])) { diff --git a/app/Admin/Services/HolidayApplyService.php b/app/Admin/Services/HolidayApplyService.php index 421811d..51d8716 100644 --- a/app/Admin/Services/HolidayApplyService.php +++ b/app/Admin/Services/HolidayApplyService.php @@ -45,7 +45,7 @@ class HolidayApplyService extends BaseService if ($user->can('admin.hr.holiday.view')) { array_push($actions, 'view'); } - if ($user->can('admin.hr.holiday.delete') && !in_array($model->workflow->check_status, [CheckStatus::Processing])) { + if ($user->can('admin.hr.holiday.delete') && !in_array($model->workflow->check_status, [CheckStatus::Processing, CheckStatus::Success])) { array_push($actions, 'delete'); } if (in_array($model->workflow->check_status, [CheckStatus::None, CheckStatus::Cancel, CheckStatus::Fail])) { diff --git a/app/Admin/Services/OfficalBusinessService.php b/app/Admin/Services/OfficalBusinessService.php index 3eb61b9..4df7b69 100644 --- a/app/Admin/Services/OfficalBusinessService.php +++ b/app/Admin/Services/OfficalBusinessService.php @@ -45,7 +45,7 @@ class OfficalBusinessService extends BaseService if ($user->can('admin.hr.business.view')) { array_push($actions, 'view'); } - if ($user->can('admin.hr.business.delete') && !in_array($model->workflow->check_status, [CheckStatus::Processing])) { + if ($user->can('admin.hr.business.delete') && !in_array($model->workflow->check_status, [CheckStatus::Processing, CheckStatus::Success])) { array_push($actions, 'delete'); } if (in_array($model->workflow->check_status, [CheckStatus::None, CheckStatus::Cancel, CheckStatus::Fail])) { diff --git a/app/Admin/Services/OvertimeApplyService.php b/app/Admin/Services/OvertimeApplyService.php index 2ef71ac..8f7e32a 100644 --- a/app/Admin/Services/OvertimeApplyService.php +++ b/app/Admin/Services/OvertimeApplyService.php @@ -45,7 +45,7 @@ class OvertimeApplyService extends BaseService if ($user->can('admin.hr.overtime.view')) { array_push($actions, 'view'); } - if ($user->can('admin.hr.overtime.delete') && !in_array($model->workflow->check_status, [CheckStatus::Processing])) { + if ($user->can('admin.hr.overtime.delete') && !in_array($model->workflow->check_status, [CheckStatus::Processing, CheckStatus::Success])) { array_push($actions, 'delete'); } if (in_array($model->workflow->check_status, [CheckStatus::None, CheckStatus::Cancel, CheckStatus::Fail])) {