From a54235695baac495b651ce7eb1da8ded4d47c2c1 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 19 May 2023 17:29:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=95=86=E5=93=81=E7=9A=84?= =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/store/product/StoreMicro.php | 11 +++++++++++ route/api.php | 1 + 2 files changed, 12 insertions(+) diff --git a/app/controller/api/store/product/StoreMicro.php b/app/controller/api/store/product/StoreMicro.php index 93476785..4b68b53b 100644 --- a/app/controller/api/store/product/StoreMicro.php +++ b/app/controller/api/store/product/StoreMicro.php @@ -28,6 +28,17 @@ class StoreMicro extends BaseController return app('json')->success($store_product); } + public function ProductDetails($id){ + $find=Db::name('store_product')->where('product_id',$id) + ->withAttr('attr_value',function ($value,$data){ + return Db::name('store_product_attr_value')->where('product_id',$data['product_id'])->select(); + }) + ->find(); + return app('json')->success(['list'=>$find]); + + + } + public function eadtProduct(){ $product_id = $this->request->param('id', 0); if ($product_id==0) return app('json')->fail('商品id不能为空'); diff --git a/route/api.php b/route/api.php index 0f21917c..8f410d9a 100644 --- a/route/api.php +++ b/route/api.php @@ -26,6 +26,7 @@ Route::group('api/', function () { Route::group('micro', function () { Route::get('seach_bar_code', '/seach_bar_code'); + Route::get('product_details', '/ProductDetails'); Route::post('eadt_product', '/eadtProduct'); })->prefix('api.store.product.StoreMicro');