qifengquan 1 year ago
parent
commit
2d002dddcb
1 changed files with 4 additions and 2 deletions
  1. 4 2
      app/data/controller/api/business/Goods.php

+ 4 - 2
app/data/controller/api/business/Goods.php

@@ -89,8 +89,10 @@ class Goods extends Controller
                 ShopGoods::mk()->where('id',$v['id'])->save(['status'=>2]);
             }
 //            $v['cover'] = explode('|',$v['cover']);
-            $index = strpos($v['cover'],"|");
-            $v['cover'] = substr($v['cover'],0,$index);
+            if($index = strpos($v['cover'],"|")){
+                $v['cover'] = substr($v['cover'],0,$index);
+            }
+            $v['cover'] = substr($v['cover'],0);
         }
         $data['count'] =$count;
         $data['list']=$result;