|
|
@ -138,11 +138,8 @@ class UserAssetsLogRepository extends BaseRepository |
|
|
|
|
|
|
|
|
|
|
|
public function userRefundEvent($orderItem) |
|
|
|
public function userRefundEvent($orderItem) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// 更新该订单的所有数据为退款状态 |
|
|
|
$item = $this->dao->getWhere(array('order_id' => $orderItem['order_id'])); |
|
|
|
$this->dao->updateOrderStatus($orderItem['order_id'], self::STATUS_REFUND); |
|
|
|
if ($item) { |
|
|
|
|
|
|
|
|
|
|
|
$item = $this->dao->getWhere(array('id' => $orderItem)); |
|
|
|
|
|
|
|
if($item){ |
|
|
|
|
|
|
|
$item->status = self::STATUS_REFUND; |
|
|
|
$item->status = self::STATUS_REFUND; |
|
|
|
$item->save(); |
|
|
|
$item->save(); |
|
|
|
} |
|
|
|
} |
|
|
@ -150,7 +147,8 @@ class UserAssetsLogRepository extends BaseRepository |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function userPayEvent($groupOrder){ |
|
|
|
public function userPayEvent($groupOrder) |
|
|
|
|
|
|
|
{ |
|
|
|
foreach ($groupOrder['orderList'] as $orderItem) { |
|
|
|
foreach ($groupOrder['orderList'] as $orderItem) { |
|
|
|
|
|
|
|
|
|
|
|
// 5. 本人使用的福利积分 |
|
|
|
// 5. 本人使用的福利积分 |
|
|
@ -317,7 +315,7 @@ class UserAssetsLogRepository extends BaseRepository |
|
|
|
$orderData = $orderRepository->orderStatisticsByUidArr($uidArr); |
|
|
|
$orderData = $orderRepository->orderStatisticsByUidArr($uidArr); |
|
|
|
foreach ($groupList as $group) { |
|
|
|
foreach ($groupList as $group) { |
|
|
|
if ($orderData['count'] >= $group['order_count'] or $orderData['sum'] >= $group['order_sum']) { |
|
|
|
if ($orderData['count'] >= $group['order_count'] or $orderData['sum'] >= $group['order_sum']) { |
|
|
|
if($group['group_id'] > $user['group_id']){ |
|
|
|
if ($group['group_id'] > $user['group_id']) { |
|
|
|
$user['group_id'] = $group['group_id']; |
|
|
|
$user['group_id'] = $group['group_id']; |
|
|
|
$user->save(); |
|
|
|
$user->save(); |
|
|
|
} |
|
|
|
} |
|
|
@ -373,7 +371,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); |
|
|
@ -574,6 +572,9 @@ class UserAssetsLogRepository extends BaseRepository |
|
|
|
if ($item['count'] > 0) { |
|
|
|
if ($item['count'] > 0) { |
|
|
|
$item['count'] = "+" . $item['count']; |
|
|
|
$item['count'] = "+" . $item['count']; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ($item['status'] == 5) { |
|
|
|
|
|
|
|
$item['type'] .= '(退款)'; |
|
|
|
|
|
|
|
} |
|
|
|
$user = $userRepository->get($item['uid']); |
|
|
|
$user = $userRepository->get($item['uid']); |
|
|
|
if ($user) { |
|
|
|
if ($user) { |
|
|
|
$item['user_nickname'] = $user['nickname']; |
|
|
|
$item['user_nickname'] = $user['nickname']; |
|
|
|