Commit 51a390ab authored by zhz's avatar zhz

goods

parent 71d11674
......@@ -943,10 +943,10 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
$existIds[] = $goodsCommonId;
$goodsCommonRedis = \Redis\Db4\GoodsCommonRedisModel::getInstance();
//周销量前3取一个
// if($goodsCommonRedis->tableSIsMember('weekSales:'.$storeId, $goodsCommonId)) {
// $tempArr[] = $goodsCommonId;
// }
if($goodsCommonRedis->tableSIsMember('weekSales:'.$storeId, $goodsCommonId)) {
$tempArr[] = $goodsCommonId;
}
if($goodsCommonRedis->sIsMember('weekSales:'.$storeId, $goodsCommonId)) {
$weekSales = $goodsCommonRedis->smembers('weekSales:'.$storeId);
if($weekSales) {
$arr = array_merge(array_diff($weekSales, $existIds));
......@@ -961,6 +961,8 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
}
}else{
$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