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