Commit 487f83e6 authored by zhz's avatar zhz

footprints

parent 84e3ce78
......@@ -46,14 +46,14 @@ class FootprintServiceModel extends \Business\AbstractModel
if($viewTime === 0){
\Error\ErrorModel::throwException(\Error\CodeConfigModel::ViewTimeNotExist);
}
$viewTime += \Our\ApiConst::oneDaySecond;
//$viewTime += \Our\ApiConst::oneDaySecond;
// if($pageSize === 0){
// \Error\ErrorModel::throwException(\Error\CodeConfigModel::commonError);
// }
$acts = \DAO\SaleMemberModel::getInstance()->isJoinPlatform($memberId);
$browseDAO = \DAO\GoodsBrowseModel::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';
//$limit = array($pageIndex*$pageSize,$pageSize);
......@@ -82,19 +82,21 @@ class FootprintServiceModel extends \Business\AbstractModel
'goodsPrice'=>$goodsCommon['goods_price'],
'viewDate'=>$dates[$v]
];
$footPrints[] = $temp;
//$footPrints[] = $temp;
$goodsCommons[$goodsCommon['goods_commonid']] = $temp;
}
}
}else{
$acts = array_keys($acts);
$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){
foreach ($list as $goodsCommon) {
$goodsCommon['goodsImage'] = \Our\ImageUtil::getGoodsImgUrl($goodsCommon['goodsImage'],360);
$goodsCommon['viewDate'] = $dates[$goodsCommon['goodsCommonId']];
$goodsCommon['groupId'] = 0;
$footPrints[] = $goodsCommon;
//$footPrints[] = $goodsCommon;
$goodsCommons[$goodsCommon['goodsCommonId']] = $goodsCommon;
}
}
}
......@@ -115,10 +117,18 @@ class FootprintServiceModel extends \Business\AbstractModel
'goodsPrice'=>$group['discountPrice'],
'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);
}
......
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