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
db48279e
Commit
db48279e
authored
Sep 05, 2018
by
zhz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
goods
parent
51a390ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
16 deletions
+10
-16
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+10
-16
No files found.
application/models/Business/Goods/GoodsCommonService.php
View file @
db48279e
...
@@ -946,23 +946,17 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
...
@@ -946,23 +946,17 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
// if($goodsCommonRedis->tableSIsMember('weekSales:'.$storeId, $goodsCommonId)) {
// if($goodsCommonRedis->tableSIsMember('weekSales:'.$storeId, $goodsCommonId)) {
// $tempArr[] = $goodsCommonId;
// $tempArr[] = $goodsCommonId;
// }
// }
if
(
$goodsCommonRedis
->
tableSIsMember
(
'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
));
if
(
$arr
)
{
if
(
$arr
)
{
shuffle
(
$arr
);
shuffle
(
$arr
);
$ret
=
array_pop
(
$arr
);
$ret
=
array_pop
(
$arr
);
if
(
$ret
)
{
if
(
$ret
)
{
$commonIds
[]
=
$ret
;
$commonIds
[]
=
$ret
;
$existIds
[]
=
$ret
;
$existIds
[]
=
$ret
;
}
}
}
}
}
}
else
{
$arr
=
$goodsCommonRedis
->
tableSRandMember
(
'weekSales:'
.
$storeId
,
1
);
$commonIds
=
array_merge
(
$commonIds
,
$arr
);
$existIds
=
array_merge
(
$existIds
,
$arr
);
}
}
//本周销售过的商品取两个
//本周销售过的商品取两个
...
@@ -990,7 +984,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
...
@@ -990,7 +984,7 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
}
}
}
}
}
}
$recommendGoods
=
$goodsCommonRedis
->
smembers
(
'
weekSale
Goods:'
.
$storeId
);
$recommendGoods
=
$goodsCommonRedis
->
smembers
(
'
recommend
Goods:'
.
$storeId
);
if
(
$recommendGoods
)
{
if
(
$recommendGoods
)
{
$arr
=
array_merge
(
array_diff
(
$recommendGoods
,
$existIds
));
$arr
=
array_merge
(
array_diff
(
$recommendGoods
,
$existIds
));
if
(
$arr
)
{
if
(
$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