From c984fa2e0b855b13480f9af602d7c17ce8d98050 Mon Sep 17 00:00:00 2001 From: Tokumeikoi Date: Sun, 11 Oct 2020 01:22:43 +0800 Subject: [PATCH] update: order service --- app/Services/OrderService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Services/OrderService.php b/app/Services/OrderService.php index 765b230a..cc8cbc78 100644 --- a/app/Services/OrderService.php +++ b/app/Services/OrderService.php @@ -9,7 +9,7 @@ use Illuminate\Support\Facades\DB; class OrderService { - CONST STRTOTIME = [ + CONST STR_TO_TIME = [ 'month_price' => 1, 'quarter_price' => 3, 'half_year_price' => 6, @@ -164,7 +164,7 @@ class OrderService private function orderIsUsed(Order $order):bool { - $month = self::STRTOTIME[$order->cycle]; + $month = self::STR_TO_TIME[$order->cycle]; $orderExpireDay = strtotime('+' . $month . ' month', $order->created_at->timestamp); if ($orderExpireDay < time()) return true; return false; @@ -183,7 +183,7 @@ class OrderService // 兼容历史余留问题 if ($item->cycle === 'onetime_price') continue; if ($this->orderIsUsed($item)) continue; - $orderSurplusMonth = $orderSurplusMonth + self::STRTOTIME[$item->cycle]; + $orderSurplusMonth = $orderSurplusMonth + self::STR_TO_TIME[$item->cycle]; $orderSurplusAmount = $orderSurplusAmount + ($item['total_amount'] + $item['balance_amount']); } if (!$orderSurplusMonth || !$orderSurplusAmount) return;