소스 검색

获取规格

afa 5 달 전
부모
커밋
673b56498d
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      app/api/controller/Shops.php

+ 3 - 2
app/api/controller/Shops.php

@@ -42,8 +42,9 @@ class Shops extends Base
         if( empty($shop_id)){
             $this->error('参数有误');
         }
-     
-        return $this->success('ok',  json_decode($shopList->where('id', $shop_id)->value('type_spec'), true));  
+        $spec = $shopList->where('id', $shop_id)->value('type_spec');
+        $shopList = $spec?json_decode($spec, true): [];
+        return $this->success('ok', $shopList);  
     }