Commit 51a390ab authored by zhz's avatar zhz

goods

parent 71d11674
...@@ -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);
} }
//本周销售过的商品取两个 //本周销售过的商品取两个
......
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