Commit 487f83e6 authored by zhz's avatar zhz

footprints

parent 84e3ce78
...@@ -46,14 +46,14 @@ class FootprintServiceModel extends \Business\AbstractModel ...@@ -46,14 +46,14 @@ class FootprintServiceModel extends \Business\AbstractModel
if($viewTime === 0){ if($viewTime === 0){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::ViewTimeNotExist); \Error\ErrorModel::throwException(\Error\CodeConfigModel::ViewTimeNotExist);
} }
$viewTime += \Our\ApiConst::oneDaySecond; //$viewTime += \Our\ApiConst::oneDaySecond;
// if($pageSize === 0){ // if($pageSize === 0){
// \Error\ErrorModel::throwException(\Error\CodeConfigModel::commonError); // \Error\ErrorModel::throwException(\Error\CodeConfigModel::commonError);
// } // }
$acts = \DAO\SaleMemberModel::getInstance()->isJoinPlatform($memberId); $acts = \DAO\SaleMemberModel::getInstance()->isJoinPlatform($memberId);
$browseDAO = \DAO\GoodsBrowseModel::getInstance(); $browseDAO = \DAO\GoodsBrowseModel::getInstance();
$commonDAO = \DAO\GoodsCommonModel::getInstance(); $commonDAO = \DAO\GoodsCommonModel::getInstance();
$where1 = "member_id = {$memberId} AND browsetime <".$viewTime; $where1 = "member_id = {$memberId} AND browsedate =".$viewTime;
$field = 'goods_commonid,browsedate,group_id'; $field = 'goods_commonid,browsedate,group_id';
//$limit = array($pageIndex*$pageSize,$pageSize); //$limit = array($pageIndex*$pageSize,$pageSize);
...@@ -82,19 +82,21 @@ class FootprintServiceModel extends \Business\AbstractModel ...@@ -82,19 +82,21 @@ class FootprintServiceModel extends \Business\AbstractModel
'goodsPrice'=>$goodsCommon['goods_price'], 'goodsPrice'=>$goodsCommon['goods_price'],
'viewDate'=>$dates[$v] 'viewDate'=>$dates[$v]
]; ];
$footPrints[] = $temp; //$footPrints[] = $temp;
$goodsCommons[$goodsCommon['goods_commonid']] = $temp;
} }
} }
}else{ }else{
$acts = array_keys($acts); $acts = array_keys($acts);
$field = 'han_goods_common.goods_commonid AS goodsCommonId,goods_name AS goodsName,goods_image AS goodsImage,goods_price AS goodsPrice'; $field = 'han_goods_common.goods_commonid AS goodsCommonId,goods_name AS goodsName,goods_image AS goodsImage,goods_price AS goodsPrice';
$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'] = \Our\ImageUtil::getGoodsImgUrl($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;
$goodsCommons[$goodsCommon['goodsCommonId']] = $goodsCommon;
} }
} }
} }
...@@ -115,10 +117,18 @@ class FootprintServiceModel extends \Business\AbstractModel ...@@ -115,10 +117,18 @@ class FootprintServiceModel extends \Business\AbstractModel
'goodsPrice'=>$group['discountPrice'], 'goodsPrice'=>$group['discountPrice'],
'viewDate'=>$dates[$group['blId']] 'viewDate'=>$dates[$group['blId']]
]; ];
$footPrints[] = $temp; $groups[$group['blId']] = $temp;
} }
} }
} }
foreach ($browseList as $browse) {
if($browse['goods_commonid']) {
$footPrints[] = $goodsCommons[$browse['goods_commonid']];
}
if($browse['group_id']) {
$footPrints[] = $groups[$browse['group_id']];
}
}
} }
return array('footprints'=>$footPrints); return array('footprints'=>$footPrints);
} }
......
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