Browse Source

Merge branch 'raccount' into relectric

stanley-king 2 years ago
parent
commit
9de862be5c

+ 5 - 0
admin/control/control.php

@@ -9,6 +9,7 @@
 defined('InShopNC') or exit('Access Invalid!');
 require_once(BASE_HELPER_PATH . '/mtopcard/mtopcard.php');
 require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
+require_once(BASE_DATA_PATH . '/model/merchant.model.php');
 class SystemControl
 {
     const STATE_TEXT = ['使用中', '已禁用'];
@@ -18,6 +19,10 @@ class SystemControl
         mtopcard\ThirdSMSProduct => '短信产品',
         mtopcard\ThirdSinopecECouponPoroduct => '中石化电子券'
     ];
+    const 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 => '订单返销'
+    ];
 	/**
 	 * 管理员资料 name id group
 	 */

+ 16 - 16
admin/control/orderstats.php

@@ -165,9 +165,21 @@ class orderstatsControl extends SystemControl
             $cond['time_type'] = $_GET['order_time_type'];
         }
 
+        $add_type_text = self::ADD_TYPE_TEXT;
         $balance_list = $mod->getBalanceList($cond, 200);
         foreach ($balance_list as &$item) {
-
+            $transfer_detail_data = [];
+
+            if(!empty($item['transfer_detail'])) {
+                $transfer_detail = json_decode($item['transfer_detail'], true);
+                foreach ($transfer_detail as $add_type => $value) {
+                    $transfer_detail_data[$add_type] = [
+                        'name' => $add_type_text[$add_type],
+                        'amount' => $value
+                    ];
+                }
+            }
+            $item['transfer_detail_data'] = $transfer_detail_data;
         }
         
         $order_time_type_text = ['notify_time' => '回调时间', 'order_time' => '下单时间'];
@@ -186,8 +198,9 @@ class orderstatsControl extends SystemControl
 
         $condition = ['end' => $end_unixtime];
 
+        $end_txt = date("Y-m-d H:i:s");
         $manager = new task\manager();
-        $task = $manager->add_task('refill_balance_stat_all',$condition,1,-1,'对账统计');
+        $task = $manager->add_task('refill_balance_stat_all',$condition,1,-1,"对账统计-{$end_txt}");
         if ($task->completed() && $task->success()) {
             exit(json_encode(['code' => true, 'msg' => '操作成功,此记录已新建成功。']));
         } else {
@@ -278,19 +291,6 @@ class orderstatsControl extends SystemControl
             showMessage('记录不存在!');
         }
 
-        $start_stamp = strtotime($_POST['start_stamp']);
-        if(empty($start_stamp)) {
-            $start_stamp = 0;
-        }
-        $end_text = $_POST['end_text'];
-        if (!empty($end_text)) {
-            $end_stamp = strtotime($end_text);
-        } else {
-            $end_stamp = 0;
-        }
-        if($start_stamp > $end_stamp){
-            showMessage('统计日期有误!');
-        }
         $success_count = $_POST['success_count'] ?? 0;
         $refill_amount = $_POST['refill_amount'] ?? 0;
         $mch_amount = $_POST['mch_amount'] ?? 0;
@@ -303,7 +303,7 @@ class orderstatsControl extends SystemControl
         $remark = $_POST['remark'] ?? '';
 
         $update = [
-            'start_stamp' => $start_stamp, 'end_stamp' => $end_stamp, 'end_text' => $end_text, 'success_count' => $success_count,
+            'success_count' => $success_count,
             'refill_amount' => $refill_amount, 'mch_amount' => $mch_amount, 'channel_amount' => $channel_amount,
             'profit_amount' => $profit_amount, 'refund_amount' => $refund_amount, 'except_amount' => $except_amount,
             'accumulate_balance' => $accumulate_balance, 'balance' => $balance, 'remark' => $remark

+ 1 - 4
admin/control/refill_evidence.php

@@ -109,10 +109,7 @@ class refill_evidenceControl extends SystemControl
     {
         $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 => '订单返销'
-        ];
+        $add_type_text = self::ADD_TYPE_TEXT;
         $is_bank_text = ['否','是'];
 
         $merchants = [];

+ 1 - 1
admin/control/refill_order_manual.php

@@ -628,7 +628,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'] = Model('merchant')::type_refund_back;
+        $input['add_type'] = merchantModel::type_refund_back;
 
         return Model('merchant')->addRefillEvidence($input);
     }

+ 13 - 3
admin/control/refill_successful.php

@@ -72,12 +72,12 @@ class refill_successfulControl extends SystemControl
         }
         $chnameData = array_unique($chname);
         sort($chnameData);
-        $result['chname'] = $chnameData;
+
         if ($type == 'system') {
             $merchants = [];
             $merchant_list = Model('')->table('merchant')->limit(1000)->field('mchid,name,company_name,time_out')->select();
-            foreach ($merchant_list as $value) {
-                $merchants[$value['mchid']] = $value;
+            foreach ($merchant_list as $merchant) {
+                $merchants[$merchant['mchid']] = $merchant;
             }
             foreach ($chnameData as $mchid) {
                 $merchant_name = $merchants[$mchid]['company_name'] == '' ? $merchants[$mchid]['name'] : $merchants[$mchid]['company_name'];
@@ -85,6 +85,16 @@ class refill_successfulControl extends SystemControl
             }
             asort($mchname);
             $result['chname'] = $mchname;
+        } else {
+            $providers = [];
+            $provider_list = $this->providers();
+            foreach ($provider_list as $provider) {
+                $providers[$provider['name']] = $provider;
+            }
+            foreach ($chnameData as $provider_name) {
+                $store_names[$provider_name] = $providers[$provider_name]['store_name'];
+            }
+            $result['chname'] = $store_names;
         }
         $amountData = array_unique($amount);
         sort($amountData);

+ 1 - 1
admin/templates/default/provider.successful.php

@@ -136,7 +136,7 @@
                 $("select[name=amount]").find('.amountOption').remove();
                 // 通道
                 for (const key in data.chname) {
-                    $("select[name=chname]").append("<option class='chnameOption' value='"+data.chname[key]+"'>"+data.chname[key]+"</option>")
+                    $("select[name=chname]").append("<option class='chnameOption' value='"+key+"'>"+data.chname[key]+"</option>")
                 }
                 // 质量
                 for (const key in data.quality) {

+ 1 - 1
helper/refill/RefillBase.php

@@ -226,7 +226,7 @@ class RefillBase
 
         $goods_id = ZERO_GOODS_ID;
         $channel_name = 'cbproxy';
-        $channel_amount = 0.00;
+        $channel_amount = $mch_amount;
 
         $mod_refill = Model('refill_order');
         [$order_success, $order_id, $order_sn] = $this->create_order($order, $goods_id, $minfo, $calc, $channel_name, $channel_amount, $mch_amount);

BIN
helper/refill/api/xyz/guochuang/20220601内蒙古移动调价函.png


BIN
helper/refill/api/xyz/guochuang/20220601陕西电信调价函.png


+ 2 - 2
helper/refill/api/xyz/guochuang/config.php

@@ -70,7 +70,7 @@ class config
         "4-10-29" => 9.755, "4-20-29" => 19.51, "4-30-29" => 29.265, "4-50-29" => 48.775, "4-100-29" => 97.55, "4-200-29" => 195.1, "4-300-29" => 292.65, "4-500-29" => 487.75,//青海 29
         "4-10-28" => 9.985, "4-20-28" => 19.97, "4-30-28" => 29.955, "4-50-28" => 49.925, "4-100-28" => 99.85, "4-200-28" => 199.7, "4-300-28" => 299.55, "4-500-28" => 499.25,//甘肃 28
         "4-10-13" => 10.22, "4-20-13" => 19.94, "4-30-13" => 29.91, "4-50-13" => 49.85, "4-100-13" => 99.7, "4-200-13" => 199.4, "4-300-13" => 300.9, "4-500-13" => 501.5,//福建 13
-        "4-10-5" => 10, "4-20-5" => 20, "4-30-5" => 30, "4-50-5" => 50, "4-100-5" => 100, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5
+        "4-10-5" => 10.01, "4-20-5" => 20.02, "4-30-5" => 30.03, "4-50-5" => 50.05, "4-100-5" => 100.1, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5
         "4-30-18" => 29.835, "4-50-18" => 49.725, "4-100-18" => 99.45, "4-200-18" => 198.3,//湖南 18
         "4-10-19" => 9.975, "4-20-19" => 19.95, "4-30-19" => 29.895, "4-50-19" => 49.825, "4-100-19" => 99.65, "4-200-19" => 199.3, "4-300-19" => 298.95, "4-500-19" => 498.25,//广东 19
         "4-10-7" => 9.82, "4-20-7" => 19.64, "4-30-7" => 29.46, "4-50-7" => 49.1, "4-100-7" => 98.2, "4-200-7" => 196.4, "4-300-7" => 294.6, "4-500-7" => 491,//吉林 7
@@ -90,7 +90,7 @@ class config
         "5-10-14" => 10.04, "5-20-14" => 20.08, "5-30-14" => 30.06, "5-50-14" => 50.1, "5-100-14" => 100.1, "5-200-14" => 200.2, "5-300-14" => 300.3, "5-500-14" => 500.5,//江西 14
         "5-20-23" => 20.08, "5-30-23" => 30.12, "5-50-23" => 50.2, "5-100-23" => 100.4, "5-200-23" => 200.8, "5-300-23" => 301.2, "5-500-23" => 502,//四川 23
         //电信
-        "6-10-27" => 9.97, "6-20-27" => 19.94, "6-30-27" => 29.91, "6-50-27" => 49.85, "6-100-27" => 99.7, "6-200-27" => 199.4, "6-300-27" => 298.5, "6-500-27" => 497.5,//陕西 27
+        "6-10-27" => 10.02, "6-20-27" => 20.04, "6-30-27" => 30.06, "6-50-27" => 50.1, "6-100-27" => 100.2, "6-200-27" => 200.4, "6-300-27" => 298.5, "6-500-27" => 497.5,//陕西 27
         "6-10-4" => 9.935, "6-20-4" => 19.87, "6-30-4" => 29.805, "6-50-4" => 49.675, "6-100-4" => 99.35, "6-200-4" => 198.7, "6-300-4" => 298.05, "6-500-4" => 496.75,//山西 4
         "6-10-18" => 10.04, "6-20-18" => 20.08, "6-30-18" => 30.12, "6-50-18" => 50.15, "6-100-18" => 100.3, "6-200-18" => 200.6, "6-300-18" => 300.9, "6-500-18" => 501.5,//湖南 18
         "6-10-15" => 10.21, "6-20-15" => 20.22, "6-30-15" => 30.231, "6-50-15" => 50.25, "6-100-15" => 100.3, "6-200-15" => 200.3, "6-300-15" => 300.45, "6-500-15" => 500.75,//山东 15

+ 2 - 2
helper/refill/api/yl/guochuang/config.php

@@ -70,7 +70,7 @@ class config
         "4-10-29" => 9.755, "4-20-29" => 19.51, "4-30-29" => 29.265, "4-50-29" => 48.775, "4-100-29" => 97.55, "4-200-29" => 195.1, "4-300-29" => 292.65, "4-500-29" => 487.75,//青海 29
         "4-10-28" => 9.985, "4-20-28" => 19.97, "4-30-28" => 29.955, "4-50-28" => 49.925, "4-100-28" => 99.85, "4-200-28" => 199.7, "4-300-28" => 299.55, "4-500-28" => 499.25,//甘肃 28
         "4-10-13" => 10.22, "4-20-13" => 19.94, "4-30-13" => 29.91, "4-50-13" => 49.85, "4-100-13" => 99.7, "4-200-13" => 199.4, "4-300-13" => 300.9, "4-500-13" => 501.5,//福建 13
-        "4-10-5" => 10, "4-20-5" => 20, "4-30-5" => 30, "4-50-5" => 50, "4-100-5" => 100, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5
+        "4-10-5" => 10.01, "4-20-5" => 20.02, "4-30-5" => 30.03, "4-50-5" => 50.05, "4-100-5" => 100.1, "4-200-5" => 200.4, "4-300-5" => 300.6, "4-500-5" => 501,//内蒙古 5
         "4-30-18" => 29.835, "4-50-18" => 49.725, "4-100-18" => 99.45, "4-200-18" => 198.3,//湖南 18
         "4-10-19" => 9.975, "4-20-19" => 19.95, "4-30-19" => 29.895, "4-50-19" => 49.825, "4-100-19" => 99.65, "4-200-19" => 199.3, "4-300-19" => 298.95, "4-500-19" => 498.25,//广东 19
         "4-10-7" => 9.82, "4-20-7" => 19.64, "4-30-7" => 29.46, "4-50-7" => 49.1, "4-100-7" => 98.2, "4-200-7" => 196.4, "4-300-7" => 294.6, "4-500-7" => 491,//吉林 7
@@ -90,7 +90,7 @@ class config
         "5-10-14" => 10.04, "5-20-14" => 20.08, "5-30-14" => 30.06, "5-50-14" => 50.1, "5-100-14" => 100.1, "5-200-14" => 200.2, "5-300-14" => 300.3, "5-500-14" => 500.5,//江西 14
         "5-20-23" => 20.08, "5-30-23" => 30.12, "5-50-23" => 50.2, "5-100-23" => 100.4, "5-200-23" => 200.8, "5-300-23" => 301.2, "5-500-23" => 502,//四川 23
         //电信
-        "6-10-27" => 9.97, "6-20-27" => 19.94, "6-30-27" => 29.91, "6-50-27" => 49.85, "6-100-27" => 99.7, "6-200-27" => 199.4, "6-300-27" => 298.5, "6-500-27" => 497.5,//陕西 27
+        "6-10-27" => 10.02, "6-20-27" => 20.04, "6-30-27" => 30.06, "6-50-27" => 50.1, "6-100-27" => 100.2, "6-200-27" => 200.4, "6-300-27" => 298.5, "6-500-27" => 497.5,//陕西 27
         "6-10-4" => 9.935, "6-20-4" => 19.87, "6-30-4" => 29.805, "6-50-4" => 49.675, "6-100-4" => 99.35, "6-200-4" => 198.7, "6-300-4" => 298.05, "6-500-4" => 496.75,//山西 4
         "6-10-18" => 10.04, "6-20-18" => 20.08, "6-30-18" => 30.12, "6-50-18" => 50.15, "6-100-18" => 100.3, "6-200-18" => 200.6, "6-300-18" => 300.9, "6-500-18" => 501.5,//湖南 18
         "6-10-15" => 10.21, "6-20-15" => 20.22, "6-30-15" => 30.231, "6-50-15" => 50.25, "6-100-15" => 100.3, "6-200-15" => 200.3, "6-300-15" => 300.45, "6-500-15" => 500.75,//山东 15