|
|
@@ -154,6 +154,7 @@ class MtController extends Controller
|
|
|
if (!empty($current)) {
|
|
|
$shopImg = $current->shopImg;
|
|
|
$picArr = json_decode($shopImg, true);
|
|
|
+ $hasErr = false;
|
|
|
if (is_array($picArr)) {
|
|
|
foreach ($picArr as $item) {
|
|
|
$url = "https://img.wixhb.com/" . $item . '?x-oss-process=image/info';
|
|
|
@@ -161,11 +162,20 @@ class MtController extends Controller
|
|
|
$result = $curl->get($url);
|
|
|
$res = json_decode($result, true);
|
|
|
if (isset($res['FileSize']) == false) {
|
|
|
- print_r($imgArr);
|
|
|
+ $hasErr = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ if ($hasErr == true) {
|
|
|
+ $newShopImg = [];
|
|
|
+ foreach ($imgArr as $imgUrl) {
|
|
|
+ $shortUrl = httpUtil::downloadRemoteImg($sjId, $shopId, $imgUrl);
|
|
|
+ $newShopImg[] = $shortUrl;
|
|
|
+ }
|
|
|
+ $current->shopImg = json_encode($newShopImg);
|
|
|
+ $current->save();
|
|
|
+ echo $current->name . " ok \n";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|