diff --git a/Application/Admin/Controller/PaymentMerchantController.class.php b/Application/Admin/Controller/PaymentMerchantController.class.php index 5e89bcb4c..da88a3dde 100644 --- a/Application/Admin/Controller/PaymentMerchantController.class.php +++ b/Application/Admin/Controller/PaymentMerchantController.class.php @@ -414,7 +414,7 @@ class PaymentMerchantController extends ThinkController $query = M('payment_rule', 'tab_')->where($conditions); $countQuery = clone $query; - $items = $query->order('id desc')->page($page, $row)->select(); + $items = $query->order('start_time desc')->page($page, $row)->select(); $count = $countQuery->count(); $gameTypes = $gameService->getGameTypes(null, 'id,type_name'); @@ -509,9 +509,11 @@ class PaymentMerchantController extends ThinkController 'message' => $message ]); } + + $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'); @@ -607,7 +609,7 @@ class PaymentMerchantController extends ThinkController ]); } - $startTime = $params['start_time'] == '' ? 0 : strtotime($params['start_time'] . ' 00:00:00'); + /* $startTime = $params['start_time'] == '' ? 0 : strtotime($params['start_time'] . ' 00:00:00'); $endTime = $params['end_time'] == '' ? PaymentRuleService::FOREVER_TIME : strtotime($params['end_time'] . ' 23:59:59'); if (date('Ymd', $rule['start_time']) <= date('Ymd') && $startTime != $rule['start_time']) { @@ -635,14 +637,14 @@ class PaymentMerchantController extends ThinkController 'status' => 0, 'message' => '最后生效时间在今日之前,不可修改' ]); - } + } */ $item = [ 'alipay_merchant_id' => $params['alipay_merchant_id'], 'weixin_merchant_id' => $params['weixin_merchant_id'], 'express_merchant_id' => $params['express_merchant_id'], - 'start_time' => $startTime, - 'end_time' => $endTime, + // 'start_time' => $startTime, + // 'end_time' => $endTime, 'update_time' => time() ]; @@ -675,6 +677,13 @@ class PaymentMerchantController extends ThinkController ]); } + if ($rule['start_time'] < strtotime(date('Y-m-d 23:59:59', time()))) { + $this->ajaxReturn([ + 'status' => 0, + 'message' => '该记录不可删除,规则开始时间包含今天或今天之前的时间。' + ]); + } + M('payment_rule', 'tab_')->where(['id' => $id])->delete(); addOperationLog([ 'op_type' => 2, @@ -735,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/Admin/View/PaymentMerchant/ruleAddForm.html b/Application/Admin/View/PaymentMerchant/ruleAddForm.html index ec5b199f8..410c50af0 100644 --- a/Application/Admin/View/PaymentMerchant/ruleAddForm.html +++ b/Application/Admin/View/PaymentMerchant/ruleAddForm.html @@ -140,7 +140,7 @@ *游戏: - + @@ -183,13 +183,13 @@ 生效时间(开始): - + 生效时间(结束): - + diff --git a/Application/Admin/View/PaymentMerchant/rules.html b/Application/Admin/View/PaymentMerchant/rules.html index ec786b695..ade22a150 100644 --- a/Application/Admin/View/PaymentMerchant/rules.html +++ b/Application/Admin/View/PaymentMerchant/rules.html @@ -124,7 +124,6 @@
搜索 新增配置 -