zhangchangchun 6 年之前
父節點
當前提交
1fda050b91
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      app/Http/Controllers/V1/ShopController.php

+ 3 - 2
app/Http/Controllers/V1/ShopController.php

@@ -42,12 +42,13 @@ class ShopController extends Controller {
     public function getShopList(Request $request){
         $data = $request->only('ids');
         $validator = Validator::make($data, [
-            'ids' => 'required|array',
+            'ids' => 'required|string',
         ]);
         if ($validator->fails()) {
             return $this->jsonError($validator->errors()->first());
         }
-        $shop = Shop::whereIn('shop_id',$data['ids'])->where('status',0)->select('shop_id','shop_name')->get();
+
+        $shop = Shop::whereIn('shop_id',explode(',',$data['ids']))->where('status',0)->select('shop_id','shop_name')->get();
         if($shop){
             return $this->jsonSuccess($shop);
         }else{