From 3a4fb5122230996506edbfe4766133d2b65e6273 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 22 Oct 2020 12:07:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=94=AF=E4=BB=98=E5=95=86?= =?UTF-8?q?=E6=88=B7=E8=A7=84=E5=88=99bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PaymentMerchantController.class.php | 10 +++++----- Application/Base/Service/PaymentRuleService.class.php | 9 +++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Application/Admin/Controller/PaymentMerchantController.class.php b/Application/Admin/Controller/PaymentMerchantController.class.php index a34b3029a..4d7996559 100644 --- a/Application/Admin/Controller/PaymentMerchantController.class.php +++ b/Application/Admin/Controller/PaymentMerchantController.class.php @@ -510,13 +510,10 @@ class PaymentMerchantController extends ThinkController ]); } - foreach ($records as $key => $record) { - $records[$key]['company_belong'] = $record['company_id'] > 0 ? -1 : $record['company_belong']; - $records[$key]['game_type_id'] = $record['game_id'] > 0 ? 0 :$record['game_type_id']; - } + $paymentRuleService = new PaymentRuleService(); + $records = $paymentRuleService->filterRecords($records); $ids = []; - $paymentRuleService = new PaymentRuleService(); foreach ($records as $record) { $startTime = $record['start_time'] == '' ? 0 : strtotime($record['start_time'] . ' 00:00:00'); $endTime = $record['end_time'] == '' ? PaymentRuleService::FOREVER_TIME : strtotime($record['end_time'] . ' 23:59:59'); @@ -747,6 +744,9 @@ class PaymentMerchantController extends ThinkController $isRepat = false; $paymentRuleService = new PaymentRuleService(); + + $records = $paymentRuleService->filterRecords($records); + foreach ($records as $record) { $rules = $paymentRuleService->getTimeRepeatRules($record); if (count($rules)) { diff --git a/Application/Base/Service/PaymentRuleService.class.php b/Application/Base/Service/PaymentRuleService.class.php index e6412c5dd..b320d1a5d 100644 --- a/Application/Base/Service/PaymentRuleService.class.php +++ b/Application/Base/Service/PaymentRuleService.class.php @@ -109,4 +109,13 @@ class PaymentRuleService } } } + + public function filterRecords($records) + { + foreach ($records as $key => $record) { + $records[$key]['company_belong'] = $record['company_id'] > 0 ? -1 : $record['company_belong']; + $records[$key]['game_type_id'] = $record['game_id'] > 0 ? 0 :$record['game_type_id']; + } + return $records; + } } \ No newline at end of file