From 8a9d66f5d3f0945b58ccbd02d4016a13d98afdda Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Sat, 28 Mar 2026 11:46:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BA=A7=E5=93=81=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=9C=AA=E6=89=BE=E5=88=B0=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E6=97=B6=E6=8A=A5=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/v1/Product.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/admin/controller/v1/Product.php b/app/admin/controller/v1/Product.php index 3b635255..5914a8ed 100644 --- a/app/admin/controller/v1/Product.php +++ b/app/admin/controller/v1/Product.php @@ -24,7 +24,7 @@ class Product 'category_id', 'created_at', 'is_show', - 'page/d' => 1, + 'page/d' => 1, 'size/d' => 10 ]); @@ -83,7 +83,7 @@ class Product ]) ->bypk(request()->param('id')) ->find() - ->bindAttr('category', ['category_name']) + ?->bindAttr('category', ['category_name']) ->hidden(['category']); if (empty($product)) { return error('产品不存在'); @@ -108,7 +108,7 @@ class Product // 获取关联产品 $product->related = ProductRelatedModel::field([ - 'related_product_id', + 'related_product_id', 'sort' ]) ->with(['product' => function($query) { @@ -149,8 +149,8 @@ class Product 'seo_desc' ]); $put = array_merge( - $put, - ['skus' => json_decode($put['skus'], true)], + $put, + ['skus' => json_decode($put['skus'], true)], ['related' => json_decode($put['related'], true)], ); @@ -305,7 +305,7 @@ class Product return success('操作成功'); } - + // 导出 public function export() { @@ -444,7 +444,7 @@ class Product }); } } - + return $products->toArray(); } }