Commit 5419c681 authored by liuyuzhen's avatar liuyuzhen

我的商户

parent c4f5a2ca
......@@ -56,6 +56,8 @@ class ImageConst{
const defaultStoreBannerName = 'default_store_banner.jpg';
const defaultCategoryImgName = 'category-headpic-default.jpg';
//图片指向的域名
const imageDomain="ossHost";
......
......@@ -159,6 +159,17 @@ class ImageUtil {
return $gcImageUrl;
}
public static function getCategoryHeadPic($gcId){
$basePath=\Bootstrap::getUrlIniConfig('source');
$commonPath=ImageConst::defaultPath;
$fileName= ImageConst::categoryHeadPicPrefix.$gcId.\Our\NameConst::jpgSuffix;
$file=$basePath.$commonPath.$fileName;
if(file_exists($file)){
return \Our\Common::getStaticFile($fileName,$commonPath);
}else{
return \Our\Common::getStaticFile(ImageConst::defaultCategoryImgName,$commonPath);
}
}
/**
* 设置文件名称 不包括 文件路径
......
......@@ -61,7 +61,7 @@ class ClassStoreServiceModel extends \Business\AbstractModel{
}
if(!isset($newGcStoreList[$gcId])){
$newGcStoreList[$gcId]['gcName'] = htmlspecialchars_decode($store['gcName']);
$newGcStoreList[$gcId]['gcImg'] = \Our\Common::getStaticFile(\Our\ImageConst::categoryHeadPicPrefix.$gcId.\Our\NameConst::jpgSuffix,\Our\ImageConst::defaultPath);
$newGcStoreList[$gcId]['gcImg'] = \Our\ImageUtil::getCategoryHeadPic($gcId);// \Our\Common::getStaticFile(\Our\ImageConst::categoryHeadPicPrefix.$gcId.\Our\NameConst::jpgSuffix,\Our\ImageConst::defaultPath);
}
unset($store['gcName']);
unset($store['gcId']);
......@@ -86,7 +86,7 @@ class ClassStoreServiceModel extends \Business\AbstractModel{
$returnData[$key] = array();
$purchasedStore = $newStoreList[$storeId];
$returnData[$key]['gcName'] = htmlspecialchars_decode($purchasedStore['gcName']);
$returnData[$key]['gcImg'] = \Our\Common::getStaticFile(\Our\ImageConst::categoryHeadPicPrefix.$purchasedStore['gcId'].\Our\NameConst::jpgSuffix,\Our\ImageConst::defaultPath);
$returnData[$key]['gcImg'] = \Our\ImageUtil::getCategoryHeadPic($purchasedStore['gcId']);//\Our\Common::getStaticFile(\Our\ImageConst::categoryHeadPicPrefix.$purchasedStore['gcId'].\Our\NameConst::jpgSuffix,\Our\ImageConst::defaultPath);
unset($purchasedStore['gcName']);
unset($purchasedStore['gcId']);
$purchasedStore['isPurchased'] = \Our\ApiConst::one;
......
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