Commit 6d169abe authored by zhz's avatar zhz

footprint

parent 0bbbe261
...@@ -666,18 +666,18 @@ class GoodsCommonServiceModel extends \Business\AbstractModel ...@@ -666,18 +666,18 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
* @return mixed * @return mixed
* @throws \Exception * @throws \Exception
*/ */
protected function getEvaluatesStatistics($commonId){ // protected function getEvaluatesStatistics($commonId){
$goodsCommonId = intval($commonId); // $goodsCommonId = intval($commonId);
$goodsScoreDAO = \DAO\GoodsScoreStatisticsModel::getInstance(); // $goodsScoreDAO = \DAO\GoodsScoreStatisticsModel::getInstance();
$commonInfo = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsScoreStatisticsRedisModel::getInstance(),array(&$goodsScoreDAO, 'getOne'),array('*',array('goods_commonid'=>$goodsCommonId)),\Our\ApiConst::oneDaySecond,array($goodsCommonId)); // $commonInfo = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsScoreStatisticsRedisModel::getInstance(),array(&$goodsScoreDAO, 'getOne'),array('*',array('goods_commonid'=>$goodsCommonId)),\Our\ApiConst::oneDaySecond,array($goodsCommonId));
if($commonInfo === false){ // if($commonInfo === false){
$commonInfo['evaluation_number'] = 0; // $commonInfo['evaluation_number'] = 0;
$commonInfo['evaluation_img_number'] = 0; // $commonInfo['evaluation_img_number'] = 0;
$commonInfo['evaluation_score'] = 0; // $commonInfo['evaluation_score'] = 0;
} // }
//
return array('totalCount'=>$commonInfo['evaluation_number'],'haveImgCount'=>$commonInfo['evaluation_img_number'],'avgScores'=>$commonInfo['evaluation_score']?number_format(($commonInfo['evaluation_score']/$commonInfo['evaluation_number']),1,'.',''):'5.0'); // return array('totalCount'=>$commonInfo['evaluation_number'],'haveImgCount'=>$commonInfo['evaluation_img_number'],'avgScores'=>$commonInfo['evaluation_score']?number_format(($commonInfo['evaluation_score']/$commonInfo['evaluation_number']),1,'.',''):'5.0');
} // }
public function getAllNearbyGoods($position){ public function getAllNearbyGoods($position){
......
...@@ -21,7 +21,7 @@ class FootprintServiceModel extends \Business\AbstractModel ...@@ -21,7 +21,7 @@ class FootprintServiceModel extends \Business\AbstractModel
$year = isset($param['year']) ? (int)$param['year'] : date('Y'); $year = isset($param['year']) ? (int)$param['year'] : date('Y');
$sort = isset($param['sort']) ? (int)$param['sort'] : 1; $sort = isset($param['sort']) ? (int)$param['sort'] : 1;
$sort == 1 ? $order = ['browsedate','ASC'] : $order = ['browsedate','DESC']; $sort == 1 ? $order = ['browsedate','ASC'] : $order = ['browsedate','DESC'];
$startTime = mktime(0,0,0,$month,1,$year); $startTime = mktime(0,0,0,$month-2,1,$year);
$endTime = mktime(0,0,-1,$month+1,1,$year); $endTime = mktime(0,0,-1,$month+1,1,$year);
$browseDAO = \DAO\GoodsBrowseModel::getInstance(); $browseDAO = \DAO\GoodsBrowseModel::getInstance();
$list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsBrowserRedisModel::getInstance(),array(&$browseDAO, 'getDistinctDate'),array($memberId,$startTime,$endTime,$order),\Our\ApiConst::tenMinSecond,array($memberId)); $list = \Our\RedisHelper::cachedFunction(\Redis\Db4\GoodsBrowserRedisModel::getInstance(),array(&$browseDAO, 'getDistinctDate'),array($memberId,$startTime,$endTime,$order),\Our\ApiConst::tenMinSecond,array($memberId));
......
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