Commit 24c597fd by 杨树贤

兼容本地垃圾数据问题

parent 88f28d8b
Showing with 5 additions and 0 deletions
......@@ -46,6 +46,8 @@ class SkuService
}
$sku = json_decode($redis->hget('sku', $goodsId), true);
if (empty($sku)) {
$sku = ['goods_id' => $goodsId];
$list[] = $sku;
continue;
}
//赋值
......@@ -106,6 +108,9 @@ class SkuService
$encodedList = array_column($list, 'encoded');
$encodedUsers = $intraCodeModel->getEncodedUserByEncoded($encodedList);
$list = array_map(function ($item) use ($encodedUsers, $redis) {
if (empty($item['goods_name'])) {
return $item;
}
$encoded = array_get($item, 'encoded', 0);
$item['encoded_user_name'] = array_get($encodedUsers, $encoded, '');
$item['moq'] = $item['moq'] ?: 0;
......
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 sign in to comment