main
panliang 2024-04-29 20:35:41 +08:00
commit 30c217a6d2
8 changed files with 14 additions and 9 deletions

View File

@ -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")}'),
]),
]);

View File

@ -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")}'),
]),
]);

View File

@ -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")}'),
]),
]);

View File

@ -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")}'),
]),
]);

View File

@ -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'))

View File

@ -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)

View File

@ -35,7 +35,7 @@ enum CheckStatus: int
self::Processing->value => '审核中',
self::Success->value => '已通过',
self::Fail->value => '已拒绝',
self::Cancel->value => '已取消',
// self::Cancel->value => '已取消',
];
}

View File

@ -122,7 +122,7 @@ class Employee extends Model implements AuthenticatableContract
*/
public function isAdministrator(): bool
{
return $this->adminUser->isAdministrator();
return $this->adminUser->inRoles(['admin', 'administrator']);
}
/**