Merge branch 'hotfix/payment_merch_bug' of wmtx/platform into release

修改商户规则配置bug
master
万盟天下 4 years ago committed by Gogs
commit ebad8b55e3

@ -510,13 +510,10 @@ class PaymentMerchantController extends ThinkController
]); ]);
} }
foreach ($records as $key => $record) { $paymentRuleService = new PaymentRuleService();
$records[$key]['company_belong'] = $record['company_id'] > 0 ? -1 : $record['company_belong']; $records = $paymentRuleService->filterRecords($records);
$records[$key]['game_type_id'] = $record['game_id'] > 0 ? 0 :$record['game_type_id'];
}
$ids = []; $ids = [];
$paymentRuleService = new PaymentRuleService();
foreach ($records as $record) { foreach ($records as $record) {
$startTime = $record['start_time'] == '' ? 0 : strtotime($record['start_time'] . ' 00:00:00'); $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'); $endTime = $record['end_time'] == '' ? PaymentRuleService::FOREVER_TIME : strtotime($record['end_time'] . ' 23:59:59');
@ -747,6 +744,9 @@ class PaymentMerchantController extends ThinkController
$isRepat = false; $isRepat = false;
$paymentRuleService = new PaymentRuleService(); $paymentRuleService = new PaymentRuleService();
$records = $paymentRuleService->filterRecords($records);
foreach ($records as $record) { foreach ($records as $record) {
$rules = $paymentRuleService->getTimeRepeatRules($record); $rules = $paymentRuleService->getTimeRepeatRules($record);
if (count($rules)) { if (count($rules)) {

@ -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;
}
} }
Loading…
Cancel
Save