Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenchuanwen
my-yaf-project
Commits
6d169abe
Commit
6d169abe
authored
Sep 04, 2018
by
zhz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
footprint
parent
0bbbe261
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+12
-12
FootprintService.php
application/models/Business/User/FootprintService.php
+1
-1
No files found.
application/models/Business/Goods/GoodsCommonService.php
View file @
6d169abe
...
...
@@ -666,18 +666,18 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
* @return mixed
* @throws \Exception
*/
protected
function
getEvaluatesStatistics
(
$commonId
){
$goodsCommonId
=
intval
(
$commonId
);
$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
));
if
(
$commonInfo
===
false
){
$commonInfo
[
'evaluation_number'
]
=
0
;
$commonInfo
[
'evaluation_img_number'
]
=
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'
);
}
//
protected function getEvaluatesStatistics($commonId){
//
$goodsCommonId = intval($commonId);
//
$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));
//
if($commonInfo === false){
//
$commonInfo['evaluation_number'] = 0;
//
$commonInfo['evaluation_img_number'] = 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');
//
}
public
function
getAllNearbyGoods
(
$position
){
...
...
application/models/Business/User/FootprintService.php
100755 → 100644
View file @
6d169abe
...
...
@@ -21,7 +21,7 @@ class FootprintServiceModel extends \Business\AbstractModel
$year
=
isset
(
$param
[
'year'
])
?
(
int
)
$param
[
'year'
]
:
date
(
'Y'
);
$sort
=
isset
(
$param
[
'sort'
])
?
(
int
)
$param
[
'sort'
]
:
1
;
$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
);
$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
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment