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(); } }