Ver código fonte

refill_evidence add_type status is_operation

haru haru 2 anos atrás
pai
commit
08e49383e9

+ 3 - 3
admin/control/merchant.php

@@ -541,9 +541,9 @@ class merchantControl extends SystemControl
             }
 
             if ($status == 'pass') {
-                $model_merchant->editRefillEvidence(['apply_id' => $apply_id], ['status' => 2, 'check_time' => time()]);
+                $model_merchant->editRefillEvidence(['apply_id' => $apply_id], ['status' => merchantModel::status_passed, 'check_time' => time()]);
             } elseif ($status == 'unpass') {
-                $model_merchant->editRefillEvidence(['apply_id' => $apply_id], ['status' => 3, 'check_time' => time()]);
+                $model_merchant->editRefillEvidence(['apply_id' => $apply_id], ['status' => merchantModel::status_denied, 'check_time' => time()]);
             } else {
                 showMessage('审核类型错误');
             }
@@ -793,7 +793,7 @@ class merchantControl extends SystemControl
             $model_merchant->editRefillEvidence(
                 ['apply_id' => $apply_id],
                 [
-                    'is_operation' => 2, 'after_available' => $after_available,
+                    'is_operation' => merchantModel::oper_deposited, 'after_available' => $after_available,
                     'admin_id' => $admininfo['id'], 'admin_name' => $admininfo['name'],
                     'receive_bank' => $receive_bank
                 ]

+ 15 - 12
admin/control/refill_evidence.php

@@ -67,18 +67,18 @@ class refill_evidenceControl extends SystemControl
             ->select();
         $success_amount = $send_amount = $cancel_amount = $mch_amount = $system_amount = $system_edit_amount = 0;
         foreach ($counts as $count) {
-            if($count['status'] == 1) {
+            if($count['status'] == merchantModel::status_applying) {
                 $send_amount += $count['amounts'];
-            }elseif ($count['status'] == 2) {
+            }elseif ($count['status'] == merchantModel::status_passed) {
                 $success_amount += $count['amounts'];
-                if($count['add_type'] == 1) {
+                if($count['add_type'] == merchantModel::type_mch_deposit) {
                     $mch_amount += $count['amounts'];
-                }elseif ($count['add_type'] == 2) {
+                }elseif ($count['add_type'] == merchantModel::type_adm_deposit) {
                     $system_amount += $count['amounts'];
-                }elseif ($count['add_type'] == 3) {
+                }elseif ($count['add_type'] == merchantModel::type_adm_adjust) {
                     $system_edit_amount += $count['amounts'];
                 }
-            }elseif ($count['status'] == 3) {
+            }elseif ($count['status'] == merchantModel::status_denied) {
                 $cancel_amount += $count['amounts'];
             }
         }
@@ -107,9 +107,12 @@ class refill_evidenceControl extends SystemControl
 
     public function formatData($data, $merchant_list)
     {
-        $status_text = ['申请中', '已通过', '已驳回'];
-        $operation_text = ['未预存', '已预存'];
-        $add_type_text = ['商户预存', '后台手动预存', '后台手动调款', '余额找平', '平台转款'];
+        $status_text = [merchantModel::status_applying =>'申请中', merchantModel::status_passed => '已通过', merchantModel::status_denied => '已驳回'];
+        $operation_text = [merchantModel::oper_undeposited => '未预存', merchantModel::oper_deposited => '已预存'];
+        $add_type_text = [
+            merchantModel::type_mch_deposit => '商户预存', merchantModel::type_adm_deposit => '后台手动预存', merchantModel::type_adm_adjust => '后台手动调款',
+            merchantModel::type_adm_finpos => '余额找平', merchantModel::type_mch_transfer => '平台转款', merchantModel::type_refund_back => '订单返销'
+        ];
         $is_bank_text = ['否','是'];
 
         $merchants = [];
@@ -119,9 +122,9 @@ class refill_evidenceControl extends SystemControl
         foreach ($data as $key => $value) {
             $data[$key]['add_time'] = date('Y-m-d H:i', $value['add_time']);
             $data[$key]['check_time'] = !empty($value['check_time']) ? date('Y-m-d H:i', $value['check_time']) : '/';
-            $data[$key]['status_text'] = $status_text[$value['status']-1];
-            $data[$key]['operation_text'] = $operation_text[$value['is_operation']-1];
-            $data[$key]['add_type_text'] = $add_type_text[$value['add_type']-1];
+            $data[$key]['status_text'] = $status_text[$value['status']];
+            $data[$key]['operation_text'] = $operation_text[$value['is_operation']];
+            $data[$key]['add_type_text'] = $add_type_text[$value['add_type']];
             $data[$key]['is_bank_text'] = $is_bank_text[$value['is_bank']];
             $data[$key]['company_name'] = $merchants[$value['mchid']]['company_name'] ?? $merchants[$value['mchid']]['name'];
         }

+ 1 - 1
admin/control/refill_order_manual.php

@@ -624,7 +624,7 @@ class refill_order_manualControl extends SystemControl
         $input['after_available'] = ncPriceFormat($mem_info['available_predeposit'] + $params['mch_amount']);
         $input['admin_name'] = $admininfo['name'];
         $input['admin_id'] = $admininfo['id'];
-        $input['add_type'] = 3;
+        $input['add_type'] = merchantModel::type_refund_back;
 
         return Model('merchant')->addRefillEvidence($input);
     }

+ 9 - 9
admin/templates/default/merchant.refill.evidence_list.php

@@ -94,21 +94,21 @@
                 <td>
                     <select name="state_sel" id="state_text">
                         <option value="">请选择...</option>
-                        <option value="1" <?php if($_GET['state_sel'] == '1'){ echo 'selected';}?>>申请中</option>
-                        <option value="2" <?php if($_GET['state_sel'] == '2'){ echo 'selected';}?>>已通过</option>
-                        <option value="3" <?php if($_GET['state_sel'] == '3'){ echo 'selected';}?>>已驳回</option>
-                        <option value="4" <?php if($_GET['state_sel'] == '4'){ echo 'selected';}?>>全部</option>
+                        <option value="<?php echo merchantModel::status_applying;?>" <?php if($_GET['state_sel'] == merchantModel::status_applying){ echo 'selected';}?>>申请中</option>
+                        <option value="<?php echo merchantModel::status_passed;?>" <?php if($_GET['state_sel'] == merchantModel::status_passed){ echo 'selected';}?>>已通过</option>
+                        <option value="<?php echo merchantModel::status_denied;?>" <?php if($_GET['state_sel'] == merchantModel::status_denied){ echo 'selected';}?>>已驳回</option>
                     </select>
                 </td>
                 <th><label for="add_type">预存类型</label></th>
                 <td>
                     <select name="add_type" id="storage_text">
                         <option value="">请选择...</option>
-                        <option value="1" <?php if($_GET['add_type'] == '1'){ echo 'selected';}?>>商户预存</option>
-                        <option value="2" <?php if($_GET['add_type'] == '2'){ echo 'selected';}?>>后台手动预存</option>
-                        <option value="3" <?php if($_GET['add_type'] == '3'){ echo 'selected';}?>>后台手动调款</option>
-                        <option value="4" <?php if($_GET['add_type'] == '4'){ echo 'selected';}?>>余额找平</option>
-                        <option value="5" <?php if($_GET['add_type'] == '5'){ echo 'selected';}?>>平台转款</option>
+                        <option value="<?php echo merchantModel::type_mch_deposit;?>" <?php if($_GET['add_type'] == merchantModel::type_mch_deposit){ echo 'selected';}?>>商户预存</option>
+                        <option value="<?php echo merchantModel::type_adm_deposit;?>" <?php if($_GET['add_type'] == merchantModel::type_adm_deposit){ echo 'selected';}?>>后台手动预存</option>
+                        <option value="<?php echo merchantModel::type_adm_adjust;?>" <?php if($_GET['add_type'] == merchantModel::type_adm_adjust){ echo 'selected';}?>>后台手动调款</option>
+                        <option value="<?php echo merchantModel::type_adm_finpos;?>" <?php if($_GET['add_type'] == merchantModel::type_adm_finpos){ echo 'selected';}?>>余额找平</option>
+                        <option value="<?php echo merchantModel::type_mch_transfer;?>" <?php if($_GET['add_type'] == merchantModel::type_mch_transfer){ echo 'selected';}?>>平台转款</option>
+                        <option value="<?php echo merchantModel::type_refund_back;?>" <?php if($_GET['add_type'] == merchantModel::type_refund_back){ echo 'selected';}?>>订单返销</option>
                     </select>
                 </td>
                 <th><label for="is_bank">转款类型</label></th>

+ 1 - 1
admin/templates/default/recharge.manual.add.php

@@ -15,7 +15,7 @@
     <form id="points_form" method="post" name="form1" enctype="multipart/form-data">
         <input type="hidden" name="form_submit" value="ok"/>
         <input type="hidden" name="type" value="<?php echo $_GET['type']; ?>"/>
-        <input type="hidden" name="add_type" value="2"/>
+        <input type="hidden" name="add_type" value="<?php echo merchantModel::type_adm_deposit; ?>"/>
         <table class="table tb-type2 nobdb">
             <tbody>
             <tr class="noborder">

+ 3 - 3
admin/templates/default/recharge.manual.edit.php

@@ -60,9 +60,9 @@
             <tr class="noborder">
                 <td class="vatop rowform">
                     <select name="add_type" id="add_type">
-                        <option value="3">手动调款</option>
-                        <option value="4">余额找平</option>
-                        <option value="5">平台转款</option>
+                        <option value="<?php echo merchantModel::type_adm_adjust; ?>">手动调款</option>
+                        <option value="<?php echo merchantModel::type_adm_finpos; ?>">余额找平</option>
+                        <option value="<?php echo merchantModel::type_mch_transfer; ?>">平台转款</option>
                     </select>
                 </td>
                 <td class="vatop tips"></td>

+ 7 - 5
admin/templates/default/refill.evidence.edit.php

@@ -38,11 +38,13 @@
             <tr class="noborder">
                 <td class="vatop rowform">
                     <select name="add_type" id="add_type">
-                        <option value="1" <?php if($output['evidence_info']['add_type'] == '1'){ echo 'selected'; }?>>商户预存</option>
-                        <option value="2" <?php if($output['evidence_info']['add_type'] == '2'){ echo 'selected'; }?>>后台手动预存</option>
-                        <option value="3" <?php if($output['evidence_info']['add_type'] == '3'){ echo 'selected'; }?>>后台手动调款</option>
-                        <option value="4" <?php if($output['evidence_info']['add_type'] == '4'){ echo 'selected'; }?>>余额找平</option>
-                        <option value="5" <?php if($output['evidence_info']['add_type'] == '5'){ echo 'selected'; }?>>平台转款</option>
+                        <option value="<?php echo merchantModel::type_mch_deposit;?>" <?php if($output['evidence_info']['add_type'] == merchantModel::type_mch_deposit){ echo 'selected';}?>>商户预存</option>
+                        <option value="<?php echo merchantModel::type_adm_deposit;?>" <?php if($output['evidence_info']['add_type'] == merchantModel::type_adm_deposit){ echo 'selected';}?>>后台手动预存</option>
+                        <option value="<?php echo merchantModel::type_adm_adjust;?>" <?php if($output['evidence_info']['add_type'] == merchantModel::type_adm_adjust){ echo 'selected';}?>>后台手动调款</option>
+                        <option value="<?php echo merchantModel::type_adm_finpos;?>" <?php if($output['evidence_info']['add_type'] == merchantModel::type_adm_finpos){ echo 'selected';}?>>余额找平</option>
+                        <option value="<?php echo merchantModel::type_mch_transfer;?>" <?php if($output['evidence_info']['add_type'] == merchantModel::type_mch_transfer){ echo 'selected';}?>>平台转款</option>
+                        <option value="<?php echo merchantModel::type_refund_back;?>" <?php if($output['evidence_info']['add_type'] == merchantModel::type_refund_back){ echo 'selected';}?>>订单返销</option>
+
                     </select>
                 </td>
                 <td class="vatop tips"></td>

+ 2 - 2
data/model/merchant.model.php

@@ -15,8 +15,8 @@ class merchantModel extends Model
     const type_adm_deposit = 2; //后台预存
     const type_adm_adjust  = 3; //后台手动调款
     const type_adm_finpos  = 4; //后台找平
-    const type_mch_transfer = 5; //
-    const type_refund_back = 6;
+    const type_mch_transfer = 5; //平台转款
+    const type_refund_back = 6; //订单返销
 
 
     public function getMerchant($mchid)