Commit 2ce93bc2 authored by zhz's avatar zhz

goodsimage

parent 7c05c1dc
...@@ -114,18 +114,22 @@ class ImageUtil { ...@@ -114,18 +114,22 @@ class ImageUtil {
* @return mixed|string 返回图片路径 * @return mixed|string 返回图片路径
*/ */
public static function getGoodsImgUrl($goodsImg,$type=240){ public static function getGoodsImgUrl($goodsImg,$type=240){
if(!in_array($type,\Our\ArrayConst::goodsImageExt)){
$type = 240; // if(!in_array($type,\Our\ArrayConst::goodsImageExt)){
} // $type = 240;
// }
if (empty($goodsImg)) { if (empty($goodsImg)) {
$directory =\Our\ImageConst::defaultPath; $directory =\Our\ImageConst::defaultPath;
$goodsImg = str_ireplace('.', '_' . $type . '.', 'default_goods_image.gif'); //$goodsImg = str_ireplace('.', '_' . $type . '.', 'default_goods_image.gif');
$goodsImg .= 'default_goods_image.gif';
}else{ }else{
$storeId = substr ( $goodsImg, 0, strpos ( $goodsImg, '_' ) ); $storeId = substr ( $goodsImg, 0, strpos ( $goodsImg, '_' ) );
$directory = \Our\ImageConst::goods.$storeId.\Our\NameConst::slash; $directory = \Our\ImageConst::goods.$storeId.\Our\NameConst::slash;
$goodsImg = str_ireplace('.', '_' . $type . '.', $goodsImg); //$goodsImg = str_ireplace('.', '_' . $type . '.', $goodsImg);
//$goodsImg .= '?x-oss-process=image/resize,m_pad,h_226,w_334';
} }
$goodsImg = \Our\Common::getStaticFile($goodsImg,$directory); $goodsImg = \Our\Common::getStaticFile($goodsImg,$directory);
$goodsImg .= '?x-oss-process=image/resize,m_pad,h_226,w_334';
return $goodsImg; return $goodsImg;
} }
......
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