From e3a637f9b71ee05c3ca067132b467a2e9986b40a Mon Sep 17 00:00:00 2001 From: zhang zhuo Date: Mon, 24 Nov 2025 13:46:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/Admin/System.php | 5 +++-- app/Model/AssetCategory.php | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Controller/Admin/System.php b/app/Controller/Admin/System.php index bb9a38c..3ac19a3 100644 --- a/app/Controller/Admin/System.php +++ b/app/Controller/Admin/System.php @@ -644,6 +644,7 @@ class System extends Base #[Auth(needAuth: false)] public function assetCategoryList() { + $param = Param::only(["type" => "image"]); $param['belong_id'] = $this->account()['belong_id']; $param['account_type'] = $this->account()['account_type']; return $this->success("资源分类列表", acModel::list($param)); @@ -655,7 +656,7 @@ class System extends Base { $request = $this->container->get(acRequest::class); $request->scene('add')->validateResolved(); - $data = Param::only(["category_name", "pid" => 0, "rank"]); + $data = Param::only(["category_name", "pid" => 0, "rank", "type" => "image"]); $data['belong_id'] = $this->account()['belong_id']; $data['account_type'] = $this->account()['account_type']; return $this->toAjax(acModel::add($data)); @@ -667,7 +668,7 @@ class System extends Base { $request = $this->container->get(acRequest::class); $request->scene('edit')->validateResolved(); - $data = Param::only(["category_id", "category_name", "pid" => 0, "rank"]); + $data = Param::only(["category_id", "category_name", "pid" => 0, "rank", "type" => "image"]); return $this->toAjax(acModel::edit($data)); } diff --git a/app/Model/AssetCategory.php b/app/Model/AssetCategory.php index c544df3..6699e5c 100644 --- a/app/Model/AssetCategory.php +++ b/app/Model/AssetCategory.php @@ -10,6 +10,7 @@ namespace App\Model; * @property int $account_type * @property int $belong_id * @property int $pid + * @property string $type * @property int $rank * @property string $create_time * @property string $update_time @@ -43,6 +44,9 @@ class AssetCategory extends Model if (isset($param['belong_id']) && $param['belong_id'] != '') { $model = $model->where('belong_id', $param['belong_id']); } + if (isset($param['type']) && $param['type'] != '') { + $model = $model->where('type', $param['type']); + } return $model ->select(["category_id", "category_name", "pid"]) ->get();