generated from liutk/owl-admin-base
service
parent
adc8cfcb9c
commit
c9eb4f02c1
|
|
@ -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])) {
|
||||
|
|
|
|||
|
|
@ -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])) {
|
||||
|
|
|
|||
|
|
@ -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])) {
|
||||
|
|
|
|||
|
|
@ -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])) {
|
||||
|
|
|
|||
|
|
@ -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])) {
|
||||
|
|
|
|||
|
|
@ -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])) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue