Browse Source

refill evidence add receive_bank

xiaoyu 3 years ago
parent
commit
47361ffe4c

+ 6 - 0
admin/config/config.ini.php

@@ -3,4 +3,10 @@ defined('InShopNC') or exit('Access Invalid!');
 
 $config['sys_log'] = true;
 
+$config['receive_bank'] = [
+    '椰子招行',
+    '椰子建行',
+    '国研建行'
+];
+
 return $config;

+ 14 - 3
admin/control/merchant.php

@@ -513,6 +513,8 @@ class merchantControl extends SystemControl
                 Tpl::output('amount', $evidence_info['amount']);
                 Tpl::output('available_predeposit', $evidence_info['available_predeposit']);
             }
+            global $config;
+            Tpl::output('receive_bank', $config['receive_bank']);
             Tpl::showpage('recharge.add');
         }
     }
@@ -527,7 +529,8 @@ class merchantControl extends SystemControl
                     ["input" => $_POST["mch_id"], "require" => "true", "message" => '机构号不能为空'],
                     ["input" => $_POST["bank_username"], "require" => "true", "message" => '开户人姓名不能为空'],
                     ["input" => $_POST["bank_name"], "require" => "true", "message" => '开户银行不能为空'],
-                    ["input" => $_POST["pointsnum"], "require" => "true", "message" => '预存金额不能为空']
+                    ["input" => $_POST["pointsnum"], "require" => "true", "message" => '预存金额不能为空'],
+                    ["input" => $_POST["receive_bank"], "require" => "true", "message" => '请选择收款银行']
                 ];
             } elseif ($type == 'edit') {
                 $obj_validate->validateparam = [
@@ -595,6 +598,8 @@ class merchantControl extends SystemControl
                 showMessage('操作失败', 'index.php?act=refill_evidence&op=index');
             }
         } else {
+            global $config;
+            Tpl::output('receive_bank', $config['receive_bank']);
             $page = "recharge.manual.{$type}";
             Tpl::showpage($page);
         }
@@ -619,6 +624,7 @@ class merchantControl extends SystemControl
         $input['admin_name'] = $admininfo['name'];
         $input['admin_id'] = $admininfo['id'];
         $input['add_type'] = $params['add_type'];
+        $input['receive_bank'] = $params['receive_bank'];
         if($params['type'] == 'add') {
             $input['is_bank'] = 1;
         }
@@ -632,7 +638,8 @@ class merchantControl extends SystemControl
         $obj_validate = new Validator();
         $obj_validate->validateparam = [
             ["input" => $_POST["apply_id"], "require" => "true", "message" => Language::get('admin_points_member_error_again')],
-            ["input" => $_POST["pointsnum"], "require" => "true", 'validator' => 'Compare', 'operator' => ' >= ', 'to' => 1, "message" => Language::get('admin_points_points_min_error')]
+            ["input" => $_POST["pointsnum"], "require" => "true", 'validator' => 'Compare', 'operator' => ' >= ', 'to' => 1, "message" => Language::get('admin_points_points_min_error')],
+            ["input" => $_POST["receive_bank"], "require" => "true", "message" => '请选择收款银行']
         ];
         $error = $obj_validate->validate();
         if ($error != '') {
@@ -705,7 +712,11 @@ class merchantControl extends SystemControl
             $after_available = ncPriceFormat($available_predeposit + $evidence_info['amount']);
             $model_merchant->editRefillEvidence(
                 ['apply_id' => $apply_id],
-                ['is_operation' => 2, 'after_available' => $after_available, 'admin_id' => $admininfo['id'], 'admin_name' => $admininfo['name']]
+                [
+                    'is_operation' => 2, 'after_available' => $after_available,
+                    'admin_id' => $admininfo['id'], 'admin_name' => $admininfo['name'],
+                    'receive_bank' => $_POST['receive_bank']
+                ]
             );
             $trans->commit();
             $this->log($log_msg, 1);

+ 6 - 0
admin/control/refill_evidence.php

@@ -37,6 +37,9 @@ class refill_evidenceControl extends SystemControl
         if (!empty($_GET['is_bank'])) {
             $condition['is_bank'] = intval($_GET['is_bank']);
         }
+        if (!empty($_GET['receive_bank'])) {
+            $condition['receive_bank'] = intval($_GET['receive_bank']);
+        }
         $export = $_GET['export'] ?? 0;
 
         $start_unixtime = intval(strtotime($_GET['query_start_time']));
@@ -92,7 +95,10 @@ class refill_evidenceControl extends SystemControl
             echo(json_encode($result));
             exit;
         }
+        global $config;
+        $receive_bank_text = $config['receive_bank'];
         Tpl::output('stats', $stats);
+        Tpl::output('receive_bank_text', $receive_bank_text);
         Tpl::output('evidence_list', $evidence_list);
         Tpl::output('page', $model_merchant->showpage('2'));
         Tpl::showpage('merchant.refill.evidence_list');

+ 12 - 1
admin/templates/default/merchant.refill.evidence_list.php

@@ -50,6 +50,15 @@
                         <option value="1" <?php if($_GET['is_bank'] == '1'){ echo 'selected';}?>>银行转账</option>
                     </select>
                 </td>
+                <th><label for="receive_bank">收款银行</label></th>
+                <td>
+                    <select name="receive_bank">
+                        <option value="">请选择...</option>
+                        <?php foreach($output['receive_bank_text'] as $key => $value){?>
+                        <option value="<?php echo $key+1;?>" <?php if($_GET['receive_bank'] == ($key+1)){ echo 'selected';}?>><?php echo $value;?></option>
+                        <?php }?>
+                    </select>
+                </td>
                 <th><label for="query_start_time">下单时间</label></th>
                 <td>
                     <input class="txt date" type="text" value="<?php echo $_GET['query_start_time']; ?>"
@@ -107,6 +116,7 @@
                 <th>申请后可用金额</th>
                 <th class="align-center">转账银行开户人姓名</th>
                 <th class="align-center">转账银行名称</th>
+                <th class="align-center">收款银行</th>
                 <th class="align-center">是否银行转账</th>
                 <th class="align-center">申请状态</th>
                 <th class="align-center">预存状态</th>
@@ -115,7 +125,7 @@
                 <th class="align-center">审核管理员</th>
                 <th class="align-center">备注信息</th>
                 <th class="align-center">预存方式</th>
-                <th class="align-center"><?php echo $lang['operation']; ?></th>
+                <th class="align-center">操作</th>
             </tr>
             </thead>
             <tbody>
@@ -134,6 +144,7 @@
                         </td>
                         <td class="align-left"><?php echo $v['bank_username']; ?></td>
                         <td class="align-left"><?php echo $v['bank_name']; ?></td>
+                        <td class="align-left"><?php echo $v['receive_bank'] ? $output['receive_bank_text'][$v['receive_bank']-1] : '/'; ?></td>
                         <td class="align-center"><?php echo $v['is_bank_text']; ?></td>
                         <td class="align-center">
                             <?php if ($v['status'] == 1){ ?>

+ 20 - 0
admin/templates/default/recharge.add.php

@@ -59,6 +59,20 @@
           <td class="vatop tips"></td>
         </tr>
         <tr>
+            <td colspan="2" class="required"><label class="validation">收款银行:</label></td>
+        </tr>
+        <tr class="noborder">
+            <td class="vatop rowform">
+                <select name="receive_bank" id="receive_bank">
+                    <option value="">请选择</option>
+                    <?php foreach ($output['receive_bank'] as $key => $value){?>
+                        <option value="<?php echo $key+1;?>"><?php echo $value;?></option>
+                    <?php }?>
+                </select>
+            </td>
+            <td class="vatop tips"></td>
+        </tr>
+        <tr>
           <td colspan="2" class="required"><label>描述信息:</label></td>
         </tr>
         <tr class="noborder">
@@ -98,6 +112,9 @@ $(function(){
 			},
             pointsnum   : {
                 required : true,
+            },
+            receive_bank   : {
+                required : true,
             }
         },
         messages : {
@@ -106,6 +123,9 @@ $(function(){
 			},
             pointsnum  : {
                 required : '请添加预存款'
+            },
+            receive_bank  : {
+                required : '请选择收款银行'
             }
         }
     });

+ 20 - 6
admin/templates/default/recharge.manual.add.php

@@ -51,6 +51,20 @@
                 <td class="vatop tips"></td>
             </tr>
             <tr>
+                <td colspan="2" class="required"><label class="validation">收款银行:</label></td>
+            </tr>
+            <tr class="noborder">
+                <td class="vatop rowform">
+                    <select name="receive_bank" id="receive_bank">
+                        <option value="">请选择</option>
+                        <?php foreach ($output['receive_bank'] as $key => $value){?>
+                        <option value="<?php echo $key+1;?>"><?php echo $value;?></option>
+                        <?php }?>
+                    </select>
+                </td>
+                <td class="vatop tips"></td>
+            </tr>
+            <tr>
                 <td colspan="2"><label>充值申请凭证:</label></td>
             </tr>
             <tr class="noborder">
@@ -88,19 +102,19 @@
         });
         $('#points_form').validate({
             rules: {
-                apply_id: {
-                    required: true
-                },
                 pointsnum: {
                     required: true,
+                },
+                receive_bank: {
+                    required: true,
                 }
             },
             messages: {
-                apply_id: {
-                    required: '请输入申请编号'
-                },
                 pointsnum: {
                     required: '请添加预存款'
+                },
+                receive_bank: {
+                    required: '请选择收款银行'
                 }
             }
         });