Browse Source

merchant manual_recharge

xiaoyu 3 years ago
parent
commit
26fd61b758

+ 1 - 0
admin/control/merchant.php

@@ -171,6 +171,7 @@ class merchantControl extends SystemControl
             $update['org_pwd'] = trim($_POST['password']);
             $update['password'] = md5($update['org_pwd']);
             $update['alarm_amount'] = $_POST['alarm_amount'] ?? 0;
+            $update['manual_recharge'] = $_POST['manual_recharge'];
 
             $day_timeout = intval($_POST['day_timeout']);
             $night_timeout = intval($_POST['night_timeout']);

+ 19 - 0
admin/templates/default/merchant.edit.php

@@ -73,6 +73,25 @@
                 <td class="vatop"><input type="text" id="night_timeout" name="night_timeout" class="txt" value="<?php echo $output['merchant']['night_timeout'];?>"></td>
                 <td class="vatop tips"></td>
             </tr>
+            <tr>
+                <td colspan="2" class="required"><label for="manual_recharge">商户后台手动充值开关:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop">
+                    <label>
+                        <input type="radio" name="manual_recharge"
+                               value="1" <?php if ($output['merchant']['manual_recharge'] == 1) {
+                            echo 'checked';
+                        } ?>>
+                    </label>开启
+                    <label>
+                        <input type="radio" name="manual_recharge"
+                               value="0" <?php if ($output['merchant']['manual_recharge'] == 0) {
+                            echo 'checked';
+                        } ?>>
+                    </label>关闭
+                </td>
+            </tr>
             </tbody>
             <tfoot>
             <tr class="tfoot">

+ 3 - 0
mchsrv/control/merchant_refill.php

@@ -52,6 +52,9 @@ class merchant_refillControl extends mbMerchantControl
         if (empty($merchant_info)) {
             return self::outerr(errcode::ErrMemberNotExist, "用户不存在.");
         }
+        if($merchant_info['manual_recharge'] != 1) {
+            return self::outerr(errcode::ErrParamter, "手动充值业务已被关闭,请联系管理员。");
+        }
 
         $amount = intval($params['amount']);
         $card_nos = trim($params['cardno']);