|
@@ -124,14 +124,15 @@ class OrderEvents
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
DB::transaction(function () use ($order) {
|
|
DB::transaction(function () use ($order) {
|
|
|
- $histories = $this->rewardPointRepository->findWhere([
|
|
|
|
|
- 'customer_id' => $order->customer_id,
|
|
|
|
|
- 'history_order_id' => $order->id,
|
|
|
|
|
- 'type_of_transaction' => RewardActiveRule::TYPE_ORDER
|
|
|
|
|
- ])->whereIn('status', [
|
|
|
|
|
- RewardPointHistory::STATUS_PENDING,
|
|
|
|
|
- RewardPointHistory::STATUS_COMPLETED
|
|
|
|
|
- ])->get();
|
|
|
|
|
|
|
+ $histories = RewardPointHistory::query()
|
|
|
|
|
+ ->where('customer_id', $order->customer_id)
|
|
|
|
|
+ ->where('history_order_id', $order->id)
|
|
|
|
|
+ ->where('type_of_transaction', RewardActiveRule::TYPE_ORDER)
|
|
|
|
|
+ ->whereIn('status', [
|
|
|
|
|
+ RewardPointHistory::STATUS_PENDING,
|
|
|
|
|
+ RewardPointHistory::STATUS_COMPLETED
|
|
|
|
|
+ ])
|
|
|
|
|
+ ->get();
|
|
|
|
|
|
|
|
foreach ($histories as $history) {
|
|
foreach ($histories as $history) {
|
|
|
$this->processCancellationHistory($history, $order);
|
|
$this->processCancellationHistory($history, $order);
|