Browse Source

获取美团商品图片 fix bug

shizhongqi 4 years ago
parent
commit
b6b5de99ba
1 changed files with 4 additions and 1 deletions
  1. 4 1
      app-hd/controllers/MtController.php

+ 4 - 1
app-hd/controllers/MtController.php

@@ -48,7 +48,10 @@ class MtController extends PublicController
 
         $picArr = [];
         $app = new Application($this->config);
-        $items = explode(trim($data['detail'], '[]'), ',');
+        $detail = $data['detail'];
+        $detail = substr_replace($detail, '{', 0, 1);
+        $detail = substr_replace($detail, '}', -1, 1);
+        $items = json_encode($detail, true);
         foreach($items as $item){
             $item = json_decode($item, true);
             $appSpuCode = $item['app_spu_code'];