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
51a390ab
Commit
51a390ab
authored
Sep 05, 2018
by
zhz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
goods
parent
71d11674
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+5
-3
No files found.
application/models/Business/Goods/GoodsCommonService.php
View file @
51a390ab
...
@@ -943,10 +943,10 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
...
@@ -943,10 +943,10 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$existIds
[]
=
$goodsCommonId
;
$existIds
[]
=
$goodsCommonId
;
$goodsCommonRedis
=
\Redis\Db4\GoodsCommonRedisModel
::
getInstance
();
$goodsCommonRedis
=
\Redis\Db4\GoodsCommonRedisModel
::
getInstance
();
//周销量前3取一个
//周销量前3取一个
// if($goodsCommonRedis->tableSIsMember('weekSales:'.$storeId, $goodsCommonId)) {
// $tempArr[] = $goodsCommonId;
// }
if
(
$goodsCommonRedis
->
tableSIsMember
(
'weekSales:'
.
$storeId
,
$goodsCommonId
))
{
if
(
$goodsCommonRedis
->
tableSIsMember
(
'weekSales:'
.
$storeId
,
$goodsCommonId
))
{
$tempArr
[]
=
$goodsCommonId
;
}
if
(
$goodsCommonRedis
->
sIsMember
(
'weekSales:'
.
$storeId
,
$goodsCommonId
))
{
$weekSales
=
$goodsCommonRedis
->
smembers
(
'weekSales:'
.
$storeId
);
$weekSales
=
$goodsCommonRedis
->
smembers
(
'weekSales:'
.
$storeId
);
if
(
$weekSales
)
{
if
(
$weekSales
)
{
$arr
=
array_merge
(
array_diff
(
$weekSales
,
$existIds
));
$arr
=
array_merge
(
array_diff
(
$weekSales
,
$existIds
));
...
@@ -961,6 +961,8 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
...
@@ -961,6 +961,8 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
}
}
}
else
{
}
else
{
$arr
=
$goodsCommonRedis
->
tableSRandMember
(
'weekSales:'
.
$storeId
,
1
);
$arr
=
$goodsCommonRedis
->
tableSRandMember
(
'weekSales:'
.
$storeId
,
1
);
$commonIds
=
array_merge
(
$commonIds
,
$arr
);
$existIds
=
array_merge
(
$existIds
,
$arr
);
}
}
//本周销售过的商品取两个
//本周销售过的商品取两个
...
...
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