Răsfoiți Sursa

获取规格

afa 5 luni în urmă
părinte
comite
673b56498d
1 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  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);  
     }