From d0d27d838193758dcb42d760bd4bbae7b12cdb48 Mon Sep 17 00:00:00 2001 From: liutk <961510893@qq.com> Date: Mon, 29 Apr 2024 16:02:43 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=9A=90=E8=97=8F=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/Hr/OfficalBusinessController.php | 2 +- app/Admin/Controllers/Hr/OvertimeController.php | 2 +- app/Admin/Controllers/Hr/PromotionController.php | 2 +- app/Admin/Controllers/Hr/SignRepairController.php | 2 +- app/Enums/CheckStatus.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) 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/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 => '已取消', ]; } From 5489a3a17c0808be2959d521fe1b8f7319c7a6db Mon Sep 17 00:00:00 2001 From: liutk <961510893@qq.com> Date: Mon, 29 Apr 2024 16:15:31 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E9=97=A8=E5=BA=97=E5=88=97=E8=A1=A8=E4=B8=AD=E9=97=A8=E5=BA=97?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/Store/StoreController.php | 2 +- app/Admin/Filters/StoreFilter.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Admin/Controllers/Store/StoreController.php b/app/Admin/Controllers/Store/StoreController.php index f552746..b35d2d6 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')) 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) From fec5502dfaeb8b0e1e17f6203e8eaa8198b2fd35 Mon Sep 17 00:00:00 2001 From: liutk <961510893@qq.com> Date: Mon, 29 Apr 2024 16:55:11 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=97=A8=E5=BA=97?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E8=AE=BE=E7=BD=AE=EF=BC=8C=E4=B8=8D=E4=B8=80?= =?UTF-8?q?=E5=AE=9A=E8=A6=81=E8=AE=BE=E7=BD=AE=E5=88=B0=E6=9C=80=E5=AD=90?= =?UTF-8?q?=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/Store/StoreController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Admin/Controllers/Store/StoreController.php b/app/Admin/Controllers/Store/StoreController.php index b35d2d6..f9bc6b3 100644 --- a/app/Admin/Controllers/Store/StoreController.php +++ b/app/Admin/Controllers/Store/StoreController.php @@ -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')) From 336ff28c163ef14ade6a1a9493947ea39baf14bb Mon Sep 17 00:00:00 2001 From: Jing Li Date: Mon, 29 Apr 2024 19:35:11 +0800 Subject: [PATCH 4/4] Update --- app/Models/Employee.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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']); } /**