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 c6e86628..44fce8a7 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');