|
|
@ -356,7 +356,7 @@ class UserAssetsLogRepository extends BaseRepository |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$item = $hotRepository->getWhere(['product_id' => $productItem['product_id'], 'uid' => $order['uid']]); |
|
|
|
$item = $hotRepository->getWhere(['uid' => $order['uid']]); |
|
|
|
if ($item) { |
|
|
|
if ($item) { |
|
|
|
$item['total'] += $product['hot_integral_total'] * $productItem['product_num']; |
|
|
|
$item['total'] += $product['hot_integral_total'] * $productItem['product_num']; |
|
|
|
$item->save(); |
|
|
|
$item->save(); |
|
|
@ -374,7 +374,7 @@ class UserAssetsLogRepository extends BaseRepository |
|
|
|
// 计算每个购买当前爆单商品的积分数据 |
|
|
|
// 计算每个购买当前爆单商品的积分数据 |
|
|
|
$profit = $productItem['total_price'] - $productItem['cost'] * $productItem['product_num']; |
|
|
|
$profit = $productItem['total_price'] - $productItem['cost'] * $productItem['product_num']; |
|
|
|
$where = array(); |
|
|
|
$where = array(); |
|
|
|
$where[] = array('product_id', '=', $productItem['product_id']); |
|
|
|
// $where[] = array('product_id', '=', $productItem['product_id']); |
|
|
|
$list = $hotRepository->getList($where); |
|
|
|
$list = $hotRepository->getList($where); |
|
|
|
|
|
|
|
|
|
|
|
$logList = array(); |
|
|
|
$logList = array(); |
|
|
@ -382,7 +382,7 @@ class UserAssetsLogRepository extends BaseRepository |
|
|
|
$tmp = $this->_getIntegral($profit * $product['hot_integral_rate'] / 100 / count($list)); |
|
|
|
$tmp = $this->_getIntegral($profit * $product['hot_integral_rate'] / 100 / count($list)); |
|
|
|
if ($item['total'] - $item['current'] < $tmp['integral_buy'] + $tmp['integral_withdraw']) { |
|
|
|
if ($item['total'] - $item['current'] < $tmp['integral_buy'] + $tmp['integral_withdraw']) { |
|
|
|
$tmp = $this->_getIntegral($item['total'] - $item['current']); |
|
|
|
$tmp = $this->_getIntegral($item['total'] - $item['current']); |
|
|
|
$item['status'] = 1; |
|
|
|
// $item['status'] = 1; |
|
|
|
} |
|
|
|
} |
|
|
|
$this->userAssetsRepository->updateAssets($item['uid'], $tmp); |
|
|
|
$this->userAssetsRepository->updateAssets($item['uid'], $tmp); |
|
|
|
$item['current'] += $tmp['integral_buy'] + $tmp['integral_withdraw']; |
|
|
|
$item['current'] += $tmp['integral_buy'] + $tmp['integral_withdraw']; |
|
|
|