diff --git a/app/Admin/Controllers/Hr/OfficalBusinessController.php b/app/Admin/Controllers/Hr/OfficalBusinessController.php index e853e03..31981e2 100644 --- a/app/Admin/Controllers/Hr/OfficalBusinessController.php +++ b/app/Admin/Controllers/Hr/OfficalBusinessController.php @@ -64,7 +64,7 @@ class OfficalBusinessController extends AdminController // $this->rowEditTypeButton('drawer', 'lg')->visibleOn('${ARRAYINCLUDES(row_actions, "view")}'), $this->rowDeleteButton()->visibleOn('${ARRAYINCLUDES(row_actions, "delete")}'), $this->applyAction()->visibleOn('${ARRAYINCLUDES(row_actions, "apply")}'), - $this->cancelAction()->visibleOn('${ARRAYINCLUDES(row_actions, "cancel")}'), + // $this->cancelAction()->visibleOn('${ARRAYINCLUDES(row_actions, "cancel")}'), ]), ]); diff --git a/app/Admin/Controllers/Hr/OvertimeController.php b/app/Admin/Controllers/Hr/OvertimeController.php index 43dab2c..bf5d419 100644 --- a/app/Admin/Controllers/Hr/OvertimeController.php +++ b/app/Admin/Controllers/Hr/OvertimeController.php @@ -65,7 +65,7 @@ class OvertimeController extends AdminController // $this->rowEditTypeButton('drawer', 'lg')->visibleOn('${ARRAYINCLUDES(row_actions, "edit")}'), $this->rowDeleteButton()->visibleOn('${ARRAYINCLUDES(row_actions, "delete")}'), $this->applyAction()->visibleOn('${ARRAYINCLUDES(row_actions, "apply")}'), - $this->cancelAction()->visibleOn('${ARRAYINCLUDES(row_actions, "cancel")}'), + // $this->cancelAction()->visibleOn('${ARRAYINCLUDES(row_actions, "cancel")}'), ]), ]); diff --git a/app/Admin/Controllers/Hr/PromotionController.php b/app/Admin/Controllers/Hr/PromotionController.php index 7978c87..f73ff83 100644 --- a/app/Admin/Controllers/Hr/PromotionController.php +++ b/app/Admin/Controllers/Hr/PromotionController.php @@ -73,7 +73,7 @@ class PromotionController extends AdminController $this->rowShowButton()->visibleOn('${ARRAYINCLUDES(row_actions, "view")}'), $this->rowEditTypeButton('drawer', 'lg')->visibleOn('${ARRAYINCLUDES(row_actions, "edit")}'), $this->rowDeleteButton()->visibleOn('${ARRAYINCLUDES(row_actions, "delete")}'), - $this->cancelAction()->visibleOn('${ARRAYINCLUDES(row_actions, "cancel")}'), + // $this->cancelAction()->visibleOn('${ARRAYINCLUDES(row_actions, "cancel")}'), ]), ]); diff --git a/app/Admin/Controllers/Hr/SignRepairController.php b/app/Admin/Controllers/Hr/SignRepairController.php index 447a022..522afa8 100644 --- a/app/Admin/Controllers/Hr/SignRepairController.php +++ b/app/Admin/Controllers/Hr/SignRepairController.php @@ -66,7 +66,7 @@ class SignRepairController extends AdminController // $this->rowEditTypeButton('drawer', 'lg')->visibleOn('${ARRAYINCLUDES(row_actions, "edit")}'), $this->rowDeleteButton()->visibleOn('${ARRAYINCLUDES(row_actions, "delete")}'), $this->applyAction()->visibleOn('${ARRAYINCLUDES(row_actions, "apply")}'), - $this->cancelAction()->visibleOn('${ARRAYINCLUDES(row_actions, "cancel")}'), + // $this->cancelAction()->visibleOn('${ARRAYINCLUDES(row_actions, "cancel")}'), ]), ]); diff --git a/app/Admin/Controllers/Store/StoreController.php b/app/Admin/Controllers/Store/StoreController.php index f552746..f9bc6b3 100644 --- a/app/Admin/Controllers/Store/StoreController.php +++ b/app/Admin/Controllers/Store/StoreController.php @@ -35,7 +35,7 @@ class StoreController extends AdminController ->source(admin_url('api/keywords/tree-list?parent_key=store_category')) ->labelField('name') ->valueField('key') - ->onlyLeaf(true) + // ->onlyLeaf(true) ->clearable(), amis()->SelectControl()->name('business_id')->label(__('store.business_id'))->columnRatio(3) ->source(admin_url('api/keywords/tree-list?parent_key=store_business')) @@ -92,7 +92,7 @@ class StoreController extends AdminController ->source(admin_url('api/keywords/tree-list?parent_key=store_category')) ->labelField('name') ->valueField('key') - ->onlyLeaf(true) + // ->onlyLeaf(true) ->required(), amis()->SelectControl()->name('business_id')->label(__('store.business_id')) ->source(admin_url('api/keywords/tree-list?parent_key=store_business')) diff --git a/app/Admin/Filters/StoreFilter.php b/app/Admin/Filters/StoreFilter.php index c4c0cb6..79339aa 100644 --- a/app/Admin/Filters/StoreFilter.php +++ b/app/Admin/Filters/StoreFilter.php @@ -4,6 +4,7 @@ namespace App\Admin\Filters; use EloquentFilter\ModelFilter; use Illuminate\Support\Arr; +use App\Models\Keyword; class StoreFilter extends ModelFilter { @@ -19,7 +20,11 @@ class StoreFilter extends ModelFilter public function category($key) { - $this->where('category_id', $key); + //先获取所有子集 + $keys = Keyword::allChildrenOfKey($key)->get()->pluck('key')->toArray(); + //把本身放入数组; + array_push($keys, $key); + $this->whereIn('category_id', $keys); } public function business($key) diff --git a/app/Enums/CheckStatus.php b/app/Enums/CheckStatus.php index 25d1725..5bc9102 100644 --- a/app/Enums/CheckStatus.php +++ b/app/Enums/CheckStatus.php @@ -35,7 +35,7 @@ enum CheckStatus: int self::Processing->value => '审核中', self::Success->value => '已通过', self::Fail->value => '已拒绝', - self::Cancel->value => '已取消', + // self::Cancel->value => '已取消', ]; } diff --git a/app/Models/Employee.php b/app/Models/Employee.php index b69db3f..f0936c6 100644 --- a/app/Models/Employee.php +++ b/app/Models/Employee.php @@ -122,7 +122,7 @@ class Employee extends Model implements AuthenticatableContract */ public function isAdministrator(): bool { - return $this->adminUser->isAdministrator(); + return $this->adminUser->inRoles(['admin', 'administrator']); } /**