Commit 2e89cba3 authored by luhongguang's avatar luhongguang

update:商品图片url

parent 14fcb105
...@@ -1354,20 +1354,18 @@ class GoodsService ...@@ -1354,20 +1354,18 @@ class GoodsService
$strList = explode(",", $picUrlStr); $strList = explode(",", $picUrlStr);
foreach ($strList as $key => $str) { foreach ($strList as $key => $str) {
$arr = explode("/", $str); $arr = explode("/", $str);
if (count($arr) == 1) { if (preg_match("/^http[s]{0,1}:\/\/([\w.]+\/?)\S*/", $str)) {
if (preg_match("/^http[s]{0,1}:\/\/([\w.]+\/?)\S*/", $str)) { $data[] = $str;
$data[] = $str; } else if (count($arr) == 1) {
if (!empty($widthSize) && !empty($highSize)) {
$urlRes = Ks3Api::picEncryptUrl($str, $widthSize, $highSize);
} else { } else {
if (!empty($widthSize) && !empty($highSize)) { $urlRes = Ks3Api::picEncryptUrl($str);
$urlRes = Ks3Api::picEncryptUrl($str, $widthSize, $highSize); }
} else { if (!empty($urlRes["response"]["data"]["url"]) && $urlRes["response"]["data"]["url"]) {
$urlRes = Ks3Api::picEncryptUrl($str); $data[] = $urlRes["response"]["data"]["url"];
} } else {
if (!empty($urlRes["response"]["data"]["url"]) && $urlRes["response"]["data"]["url"]) { continue;
$data[] = $urlRes["response"]["data"]["url"];
} else {
continue;
}
} }
} else { } else {
$bucket = $arr[0]; $bucket = $arr[0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment