Commit bfd6759f authored by zhz's avatar zhz

goodsimage

parent 87d2ca77
...@@ -9,7 +9,8 @@ class SettingServiceModel extends \Business\AbstractModel{ ...@@ -9,7 +9,8 @@ class SettingServiceModel extends \Business\AbstractModel{
$settingDAO = \DAO\SettingModel::getInstance(); $settingDAO = \DAO\SettingModel::getInstance();
$type == 0 ? $version = $settingDAO->getListCache(array('android_version','android_apk')) : $version = $settingDAO->getListCache(array('ios_version')); $type == 0 ? $version = $settingDAO->getListCache(array('android_version','android_apk')) : $version = $settingDAO->getListCache(array('ios_version'));
if($version['android_version']) { if($version['android_version']) {
return array('version'=>$version['android_version'],'url'=>'http://qm.22ca.com/mall/index.php?act=desc&op=upload&file_name='.$version['android_apk']); $host = 'http://testadmin.shenbd.com';
return array('version'=>$version['android_version'],'url'=>$host . '/mall/index.php?act=desc&op=upload&file_name='.$version['android_apk']);
} }
return array('version'=>$version['ios_version']); return array('version'=>$version['ios_version']);
} }
......
...@@ -24,7 +24,7 @@ class CommentServiceModel extends \Business\AbstractModel { ...@@ -24,7 +24,7 @@ class CommentServiceModel extends \Business\AbstractModel {
if(is_array($list) && !empty($list)){ if(is_array($list) && !empty($list)){
$totalCount = \Our\RedisHelper::cachedFunction(\Redis\Db6\CommentToBuyerRedisModel::getInstance(),array(&$CommentToBuyerDAO, 'getCount'),array($where),\Our\ApiConst::oneMinute,array($memberId)); $totalCount = \Our\RedisHelper::cachedFunction(\Redis\Db6\CommentToBuyerRedisModel::getInstance(),array(&$CommentToBuyerDAO, 'getCount'),array($where),\Our\ApiConst::oneMinute,array($memberId));
foreach ($list as $v){ foreach ($list as $v){
$comments[] = array('id'=>$v['id'],'goodsImage'=>\DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goods_image']),'content'=>$v['content'],'state'=>$v['state'],'addTime'=>$v['addtime']); $comments[] = array('id'=>$v['id'],'goodsImage'=>\Our\ImageUtil::getGoodsImgUrl($v['goods_image']),'content'=>$v['content'],'state'=>$v['state'],'addTime'=>$v['addtime']);
} }
}else{ }else{
$totalCount = 0; $totalCount = 0;
......
...@@ -18,7 +18,7 @@ class EvaluationServiceModel extends \Business\AbstractModel { ...@@ -18,7 +18,7 @@ class EvaluationServiceModel extends \Business\AbstractModel {
} }
$goods = []; $goods = [];
foreach ($orderGoods as $k=>$v){ foreach ($orderGoods as $k=>$v){
$goods[] = array('goodsId'=>$v['goods_id'],'goodsName'=>$v['goods_name'],'goodsPrice'=>$v['goods_pay_price'],'goodsNum'=>$v['goods_num'],'goodsImage'=>\DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goods_image'])); $goods[] = array('goodsId'=>$v['goods_id'],'goodsName'=>$v['goods_name'],'goodsPrice'=>$v['goods_pay_price'],'goodsNum'=>$v['goods_num'],'goodsImage'=>\Our\ImageUtil::getGoodsImgUrl($v['goods_image']));
} }
$serviceEvaluations = []; $serviceEvaluations = [];
if($order['diliveryman_id']) { if($order['diliveryman_id']) {
......
...@@ -139,7 +139,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -139,7 +139,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$commonDAO = \DAO\GoodsCommonModel::getInstance(); $commonDAO = \DAO\GoodsCommonModel::getInstance();
foreach ($list as $v){ foreach ($list as $v){
unset($v['goods_price']); unset($v['goods_price']);
$v['goodsImage'] = $commonDAO->getGoodsImgSrc($v['goodsImage']); $v['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($v['goodsImage']);
$v['goodsPrice'] = (int)$v['goodsPrice']; $v['goodsPrice'] = (int)$v['goodsPrice'];
$goodsList[] = $v; $goodsList[] = $v;
} }
...@@ -261,7 +261,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -261,7 +261,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
if(is_array($list) && !empty($list)){ if(is_array($list) && !empty($list)){
$totalCount = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonDAO, 'getCount'),array(implode(' and ',$where),$attrStr),\Our\ApiConst::oneDaySecond,array($storeId)); $totalCount = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonDAO, 'getCount'),array(implode(' and ',$where),$attrStr),\Our\ApiConst::oneDaySecond,array($storeId));
foreach ($list as $v){ foreach ($list as $v){
$v['goodsImage'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goodsImage'],360); $v['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($v['goodsImage'],360);
$v['goodsPrice'] = (int)$v['goodsPrice']; $v['goodsPrice'] = (int)$v['goodsPrice'];
unset($v['goods_price']); unset($v['goods_price']);
$goods[] = $v; $goods[] = $v;
...@@ -285,7 +285,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -285,7 +285,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$goodsCommonId = intval($param['goodsCommonId']); $goodsCommonId = intval($param['goodsCommonId']);
$attrs = $this->getAttr($goodsCommonId,$memberId); $attrs = $this->getAttr($goodsCommonId,$memberId);
$commonInfo = $attrs['commonInfo']; $commonInfo = $attrs['commonInfo'];
$commonInfo['goods_image'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($commonInfo['goods_image']); $commonInfo['goods_image'] = \Our\ImageUtil::getGoodsImgUrl($commonInfo['goods_image']);
//所在地 //所在地
$area = ''; $area = '';
...@@ -326,14 +326,14 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -326,14 +326,14 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$attrbuteDAO = \DAO\GoodsAttributeModel::getInstance(); $attrbuteDAO = \DAO\GoodsAttributeModel::getInstance();
$productData = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsAttributeRedisModel::getInstance(),array(&$attrbuteDAO, 'option'),array('attribute,attribute_value',array('goods_commonid'=>$goodsCommonId)),\Our\ApiConst::oneDaySecond,array($goodsCommonId)); $productData = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsAttributeRedisModel::getInstance(),array(&$attrbuteDAO, 'option'),array('attribute,attribute_value',array('goods_commonid'=>$goodsCommonId)),\Our\ApiConst::oneDaySecond,array($goodsCommonId));
$html = array('width'=>750,'height'=>$commonInfo['goods_height'],'url'=>'http://qm.22ca.com/mall/index.php?act=desc&op=getDes&goodsCommonId='.$goodsCommonId); $html = array('width'=>750,'height'=>$commonInfo['goods_height'],'url'=>'/index/goodsDetail?goodsCommonId='.$goodsCommonId);
unset($attrs['commonInfo']); unset($attrs['commonInfo']);
return array_merge(array('storeId'=>$commonInfo['store_id'],'goodsId'=>$commonInfo['goodsId'],'goodsName'=>$commonInfo['goods_name'],'goodsVerify'=>$commonInfo['goods_verify'],'goodsState'=>$commonInfo['goods_state'],'saleCount'=>$commonInfo['sale_num'],'collectionState'=>$collectionState,'isOwn'=>$isOwn,'isHot'=>$commonInfo['goods_hot'],'isRecoment'=>$commonInfo['goods_commend'],'isFree'=>$commonInfo['goods_free'],'isVirtual'=>$commonInfo['is_virtual'],'goodsMostLimit'=>$commonInfo['goods_most_limit'],'goodsLeastLimit'=>$commonInfo['goods_least_limit'],'goodsTotalLimit'=>$commonInfo['goods_total_limit'],'address'=>$area,'range'=>$rangePrice,'productData'=>$productData,'htmlContent'=>$html,'videoUrl'=>$commonInfo['goods_youku_url']),$attrs); return array_merge(array('storeId'=>$commonInfo['store_id'],'goodsId'=>$commonInfo['goodsId'],'goodsName'=>$commonInfo['goods_name'],'goodsVerify'=>$commonInfo['goods_verify'],'goodsState'=>$commonInfo['goods_state'],'saleCount'=>$commonInfo['sale_num'],'collectionState'=>$collectionState,'isOwn'=>$isOwn,'isHot'=>$commonInfo['goods_hot'],'isRecoment'=>$commonInfo['goods_commend'],'isFree'=>$commonInfo['goods_free'],'isVirtual'=>$commonInfo['is_virtual'],'goodsMostLimit'=>$commonInfo['goods_most_limit'],'goodsLeastLimit'=>$commonInfo['goods_least_limit'],'goodsTotalLimit'=>$commonInfo['goods_total_limit'],'address'=>$area,'range'=>$rangePrice,'productData'=>$productData,'htmlContent'=>$html,'videoUrl'=>$commonInfo['goods_youku_url']),$attrs);
} }
public function getAttr($goodsCommonId,$memberId = null){ public function getAttr($goodsCommonId,$memberId = null){
$goodsCommonId = (int)$goodsCommonId; $goodsCommonId = (int)$goodsCommonId;
$commonInfo = $this->checkGoodsCommon($goodsCommonId); $commonInfo = $this->checkGoodsCommon($goodsCommonId);
$commonInfo['goods_image'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($commonInfo['goods_image']); $commonInfo['goods_image'] = \Our\ImageUtil::getGoodsImgUrl($commonInfo['goods_image']);
//该用户是否有参加销售活动 //该用户是否有参加销售活动
//$activities = $this->isJoin($commonInfo['store_id'],$memberId); //$activities = $this->isJoin($commonInfo['store_id'],$memberId);
$activities = \DAO\SaleMemberModel::getInstance()->isJoinStore($commonInfo['store_id'],$memberId); $activities = \DAO\SaleMemberModel::getInstance()->isJoinStore($commonInfo['store_id'],$memberId);
...@@ -348,7 +348,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -348,7 +348,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
if($image && is_array($image)){ if($image && is_array($image)){
$i = 0; $i = 0;
foreach ($image as $k=>$v){ foreach ($image as $k=>$v){
$image[$k]['goods_image'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goods_image'],1280); $image[$k]['goods_image'] = \Our\ImageUtil::getGoodsImgUrl($v['goods_image'],1280);
$attrImage[$v['attr_name']][$v['attr_value']][] = $image[$k]['goods_image']; $attrImage[$v['attr_name']][$v['attr_value']][] = $image[$k]['goods_image'];
if($i < 5 ){ if($i < 5 ){
$images[] = $image[$k]['goods_image']; $images[] = $image[$k]['goods_image'];
...@@ -476,7 +476,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -476,7 +476,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
// $goods = []; // $goods = [];
// if(is_array($goodsList) && !empty($goodsList)){ // if(is_array($goodsList) && !empty($goodsList)){
// foreach ($goodsList as $v){ // foreach ($goodsList as $v){
// $v['goodsImage'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goodsImage'],360); // $v['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($v['goodsImage'],360);
// $v['goodsPrice'] = (int)$v['goodsPrice']; // $v['goodsPrice'] = (int)$v['goodsPrice'];
// unset($v['goods_price']); // unset($v['goods_price']);
// $goods[] = $v; // $goods[] = $v;
...@@ -968,7 +968,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -968,7 +968,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$goods[] = [ $goods[] = [
'goodsCommonId'=>$v['goods_commonid'], 'goodsCommonId'=>$v['goods_commonid'],
'goodsName'=>$v['goods_name'], 'goodsName'=>$v['goods_name'],
'goodsImage'=>\DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goods_image'],360), 'goodsImage'=>\Our\ImageUtil::getGoodsImgUrl($v['goods_image'],360),
'goodsMarketPrice'=>$v['goods_marketprice'], 'goodsMarketPrice'=>$v['goods_marketprice'],
'goodsPrice'=>$v['goods_price'] 'goodsPrice'=>$v['goods_price']
]; ];
......
...@@ -41,7 +41,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel { ...@@ -41,7 +41,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$data['image'] = []; $data['image'] = [];
if($blImg = unserialize($data['bl_image'])){ if($blImg = unserialize($data['bl_image'])){
foreach ($blImg as $v){ foreach ($blImg as $v){
$data['image'][] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v,1280); $data['image'][] = \Our\ImageUtil::getGoodsImgUrl($v,1280);
} }
} }
$data['goods'] = []; $data['goods'] = [];
......
...@@ -301,7 +301,7 @@ class OrderServiceModel extends \Business\AbstractModel ...@@ -301,7 +301,7 @@ class OrderServiceModel extends \Business\AbstractModel
$return['expressImage'] = Common::getStaticFile($shippingExpressInfo['eImage'], ImageConst::expressPath); $return['expressImage'] = Common::getStaticFile($shippingExpressInfo['eImage'], ImageConst::expressPath);
$return['goodsName'] = $orderGoods['goodsName']; $return['goodsName'] = $orderGoods['goodsName'];
$return['goodsId'] = $orderGoods['goodsId']; $return['goodsId'] = $orderGoods['goodsId'];
$return['goodsImage'] = $goodsCommonDao->getGoodsImgSrc($orderGoods['goodsImage'], ArrayConst::goodsImageExt[ApiConst::goodsSmallSize]); $return['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($orderGoods['goodsImage'], ArrayConst::goodsImageExt[ApiConst::goodsSmallSize]);
$return['goodsAttr'] = $goodsDao->getFormatGoodsAttr($orderGoods['goodsSpec']); $return['goodsAttr'] = $goodsDao->getFormatGoodsAttr($orderGoods['goodsSpec']);
$return['orderPrice'] = $order['orderAmount']; $return['orderPrice'] = $order['orderAmount'];
$return['expressInfo'] = $order['shippingHtml'] ? unserialize($order['shippingHtml']) : array(); $return['expressInfo'] = $order['shippingHtml'] ? unserialize($order['shippingHtml']) : array();
......
...@@ -799,7 +799,7 @@ class StoreServiceModel extends \Business\AbstractModel{ ...@@ -799,7 +799,7 @@ class StoreServiceModel extends \Business\AbstractModel{
//// $bundingGoodsDAO = \DAO\PBundlingGoodsModel::getInstance(); //// $bundingGoodsDAO = \DAO\PBundlingGoodsModel::getInstance();
//// $goods = \Our\RedisHelper::cachedFunction(\Redis\Db4\PBundlingGoodsRedisModel::getInstance(),array(&$bundingGoodsDAO, 'getList'),array('bl_id,goods_commonid AS goodsCommonId,goods_name AS goodsName,goods_image AS goodsImage,bl_count_price AS goodsPrice,bl_goods_price AS discountPrice,num','bl_id in('.implode(',',$blIds).')'),\Our\ApiConst::oneDaySecond,array($storeId)); //// $goods = \Our\RedisHelper::cachedFunction(\Redis\Db4\PBundlingGoodsRedisModel::getInstance(),array(&$bundingGoodsDAO, 'getList'),array('bl_id,goods_commonid AS goodsCommonId,goods_name AS goodsName,goods_image AS goodsImage,bl_count_price AS goodsPrice,bl_goods_price AS discountPrice,num','bl_id in('.implode(',',$blIds).')'),\Our\ApiConst::oneDaySecond,array($storeId));
//// foreach ($goods as $v){ //// foreach ($goods as $v){
//// $v['goodsImage'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goodsImage']); //// $v['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($v['goodsImage']);
//// $bl_id = $v['bl_id']; //// $bl_id = $v['bl_id'];
//// $v['goodsAttr'] = []; //// $v['goodsAttr'] = [];
//// unset($v['bl_id']); //// unset($v['bl_id']);
...@@ -839,7 +839,7 @@ class StoreServiceModel extends \Business\AbstractModel{ ...@@ -839,7 +839,7 @@ class StoreServiceModel extends \Business\AbstractModel{
if(is_array($list) && !empty($list)){ if(is_array($list) && !empty($list)){
foreach ($list as $v){ foreach ($list as $v){
unset($v['goods_price']); unset($v['goods_price']);
$v['goodsImage'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goodsImage'],360); $v['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($v['goodsImage'],360);
$v['goodsPrice'] = (int)$v['goodsPrice']; $v['goodsPrice'] = (int)$v['goodsPrice'];
$goods[] = $v; $goods[] = $v;
} }
......
...@@ -78,7 +78,7 @@ class FootprintServiceModel extends \Business\AbstractModel ...@@ -78,7 +78,7 @@ class FootprintServiceModel extends \Business\AbstractModel
'goodsCommonId'=>$goodsCommon['goods_commonid'], 'goodsCommonId'=>$goodsCommon['goods_commonid'],
'groupId'=>0, 'groupId'=>0,
'goodsName'=>$goodsCommon['goods_name'], 'goodsName'=>$goodsCommon['goods_name'],
'goodsImage'=>\DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($goodsCommon['goods_image'],360), 'goodsImage'=>\Our\ImageUtil::getGoodsImgUrl($goodsCommon['goods_image'],360),
'goodsPrice'=>$goodsCommon['goods_price'], 'goodsPrice'=>$goodsCommon['goods_price'],
'viewDate'=>$dates[$v] 'viewDate'=>$dates[$v]
]; ];
...@@ -91,7 +91,7 @@ class FootprintServiceModel extends \Business\AbstractModel ...@@ -91,7 +91,7 @@ class FootprintServiceModel extends \Business\AbstractModel
$list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonDAO, 'getListWithSale'),array($where,$field,$acts,[],[],'',false),\Our\ApiConst::oneMinute); $list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsCommonRedisModel::getInstance(),array(&$commonDAO, 'getListWithSale'),array($where,$field,$acts,[],[],'',false),\Our\ApiConst::oneMinute);
if($list){ if($list){
foreach ($list as $goodsCommon) { foreach ($list as $goodsCommon) {
$goodsCommon['goodsImage'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($goodsCommon['goodsImage'],360); $goodsCommon['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($goodsCommon['goodsImage'],360);
$goodsCommon['viewDate'] = $dates[$goodsCommon['goodsCommonId']]; $goodsCommon['viewDate'] = $dates[$goodsCommon['goodsCommonId']];
$goodsCommon['groupId'] = 0; $goodsCommon['groupId'] = 0;
$footPrints[] = $goodsCommon; $footPrints[] = $goodsCommon;
...@@ -111,7 +111,7 @@ class FootprintServiceModel extends \Business\AbstractModel ...@@ -111,7 +111,7 @@ class FootprintServiceModel extends \Business\AbstractModel
'goodsCommonId'=>0, 'goodsCommonId'=>0,
'groupId'=>$group['blId'], 'groupId'=>$group['blId'],
'goodsName'=>$group['name'], 'goodsName'=>$group['name'],
'goodsImage'=>\DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($group['image'],360), 'goodsImage'=>\Our\ImageUtil::getGoodsImgUrl($group['image'],360),
'goodsPrice'=>$group['discountPrice'], 'goodsPrice'=>$group['discountPrice'],
'viewDate'=>$dates[$group['blId']] 'viewDate'=>$dates[$group['blId']]
]; ];
......
...@@ -232,7 +232,7 @@ class MemberCenterServiceModel extends \Business\AbstractModel ...@@ -232,7 +232,7 @@ class MemberCenterServiceModel extends \Business\AbstractModel
// } // }
foreach ($list as $v){ foreach ($list as $v){
//if($stores['store_id'] && $stores['store_id']['open_flag'] == 1 && $stores['store_id']['store_state'] == 1) { //if($stores['store_id'] && $stores['store_id']['open_flag'] == 1 && $stores['store_id']['store_state'] == 1) {
$goods[] = array('favid'=>$v['favid'],'goodsCommonId'=>$v['goods_commonid'],'goodsImage'=>\DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goods_image']),'goodsName'=>$v['goods_name'],'goodsPrice'=>$v['goods_price'],'goodsId'=>$v['goods_id']); $goods[] = array('favid'=>$v['favid'],'goodsCommonId'=>$v['goods_commonid'],'goodsImage'=>\Our\ImageUtil::getGoodsImgUrl($v['goods_image']),'goodsName'=>$v['goods_name'],'goodsPrice'=>$v['goods_price'],'goodsId'=>$v['goods_id']);
// } // }
} }
} }
......
...@@ -56,7 +56,7 @@ class StoreGoodsClassModel extends \DAO\AbstractModel { ...@@ -56,7 +56,7 @@ class StoreGoodsClassModel extends \DAO\AbstractModel {
$recommendGoods = array(); $recommendGoods = array();
if($data){ if($data){
foreach ($data as $v){ foreach ($data as $v){
$goods = array('goodsCommonId'=>$v['goods_commonid'],'goodsName'=>$v['goods_name'],'goodsImage'=>\DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goods_image']),'goodsPrice'=>(int)$v['price'],'goodsMarketPrice'=>$v['goods_marketprice']); $goods = array('goodsCommonId'=>$v['goods_commonid'],'goodsName'=>$v['goods_name'],'goodsImage'=>\Our\ImageUtil::getGoodsImgUrl($v['goods_image']),'goodsPrice'=>(int)$v['price'],'goodsMarketPrice'=>$v['goods_marketprice']);
if(key_exists($v['stc_id'],$recommendGoods)){ if(key_exists($v['stc_id'],$recommendGoods)){
if(count($recommendGoods[$v['stc_id']]['goods']) >= 8){ if(count($recommendGoods[$v['stc_id']]['goods']) >= 8){
continue; continue;
......
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