Commit bfd6759f authored by zhz's avatar zhz

goodsimage

parent 87d2ca77
......@@ -9,7 +9,8 @@ class SettingServiceModel extends \Business\AbstractModel{
$settingDAO = \DAO\SettingModel::getInstance();
$type == 0 ? $version = $settingDAO->getListCache(array('android_version','android_apk')) : $version = $settingDAO->getListCache(array('ios_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']);
}
......
......@@ -24,7 +24,7 @@ class CommentServiceModel extends \Business\AbstractModel {
if(is_array($list) && !empty($list)){
$totalCount = \Our\RedisHelper::cachedFunction(\Redis\Db6\CommentToBuyerRedisModel::getInstance(),array(&$CommentToBuyerDAO, 'getCount'),array($where),\Our\ApiConst::oneMinute,array($memberId));
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{
$totalCount = 0;
......
......@@ -18,7 +18,7 @@ class EvaluationServiceModel extends \Business\AbstractModel {
}
$goods = [];
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 = [];
if($order['diliveryman_id']) {
......
......@@ -139,7 +139,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$commonDAO = \DAO\GoodsCommonModel::getInstance();
foreach ($list as $v){
unset($v['goods_price']);
$v['goodsImage'] = $commonDAO->getGoodsImgSrc($v['goodsImage']);
$v['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($v['goodsImage']);
$v['goodsPrice'] = (int)$v['goodsPrice'];
$goodsList[] = $v;
}
......@@ -261,7 +261,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
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));
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'];
unset($v['goods_price']);
$goods[] = $v;
......@@ -285,7 +285,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$goodsCommonId = intval($param['goodsCommonId']);
$attrs = $this->getAttr($goodsCommonId,$memberId);
$commonInfo = $attrs['commonInfo'];
$commonInfo['goods_image'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($commonInfo['goods_image']);
$commonInfo['goods_image'] = \Our\ImageUtil::getGoodsImgUrl($commonInfo['goods_image']);
//所在地
$area = '';
......@@ -326,14 +326,14 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$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));
$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']);
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){
$goodsCommonId = (int)$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 = \DAO\SaleMemberModel::getInstance()->isJoinStore($commonInfo['store_id'],$memberId);
......@@ -348,7 +348,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
if($image && is_array($image)){
$i = 0;
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'];
if($i < 5 ){
$images[] = $image[$k]['goods_image'];
......@@ -476,7 +476,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
// $goods = [];
// if(is_array($goodsList) && !empty($goodsList)){
// 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'];
// unset($v['goods_price']);
// $goods[] = $v;
......@@ -968,7 +968,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$goods[] = [
'goodsCommonId'=>$v['goods_commonid'],
'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'],
'goodsPrice'=>$v['goods_price']
];
......
......@@ -41,7 +41,7 @@ class GroupSaleServiceModel extends \Business\AbstractModel {
$data['image'] = [];
if($blImg = unserialize($data['bl_image'])){
foreach ($blImg as $v){
$data['image'][] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v,1280);
$data['image'][] = \Our\ImageUtil::getGoodsImgUrl($v,1280);
}
}
$data['goods'] = [];
......
......@@ -301,7 +301,7 @@ class OrderServiceModel extends \Business\AbstractModel
$return['expressImage'] = Common::getStaticFile($shippingExpressInfo['eImage'], ImageConst::expressPath);
$return['goodsName'] = $orderGoods['goodsName'];
$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['orderPrice'] = $order['orderAmount'];
$return['expressInfo'] = $order['shippingHtml'] ? unserialize($order['shippingHtml']) : array();
......
......@@ -799,7 +799,7 @@ class StoreServiceModel extends \Business\AbstractModel{
//// $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));
//// foreach ($goods as $v){
//// $v['goodsImage'] = \DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($v['goodsImage']);
//// $v['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($v['goodsImage']);
//// $bl_id = $v['bl_id'];
//// $v['goodsAttr'] = [];
//// unset($v['bl_id']);
......@@ -839,7 +839,7 @@ class StoreServiceModel extends \Business\AbstractModel{
if(is_array($list) && !empty($list)){
foreach ($list as $v){
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'];
$goods[] = $v;
}
......
......@@ -78,7 +78,7 @@ class FootprintServiceModel extends \Business\AbstractModel
'goodsCommonId'=>$goodsCommon['goods_commonid'],
'groupId'=>0,
'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'],
'viewDate'=>$dates[$v]
];
......@@ -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);
if($list){
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['groupId'] = 0;
$footPrints[] = $goodsCommon;
......@@ -111,7 +111,7 @@ class FootprintServiceModel extends \Business\AbstractModel
'goodsCommonId'=>0,
'groupId'=>$group['blId'],
'goodsName'=>$group['name'],
'goodsImage'=>\DAO\GoodsCommonModel::getInstance()->getGoodsImgSrc($group['image'],360),
'goodsImage'=>\Our\ImageUtil::getGoodsImgUrl($group['image'],360),
'goodsPrice'=>$group['discountPrice'],
'viewDate'=>$dates[$group['blId']]
];
......
......@@ -232,7 +232,7 @@ class MemberCenterServiceModel extends \Business\AbstractModel
// }
foreach ($list as $v){
//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 {
$recommendGoods = array();
if($data){
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(count($recommendGoods[$v['stc_id']]['goods']) >= 8){
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