Procházet zdrojové kódy

Merge branch 'raccount' into rchannel

xiaoyu před 3 roky
rodič
revize
6d3ca83dc7

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

@@ -20,4 +20,8 @@ $config['receive_bank'] = [
     ]
 ];
 
+$config['test_mchid'] = [
+    1092, 10165, 10112
+];
+
 return $config;

+ 17 - 5
admin/control/merchant.php

@@ -26,20 +26,32 @@ class merchantControl extends SystemControl
      */
     public function merchantOp()
     {
+        global $config;
         $model_merchant = Model('merchant');
-
+        $condition = [];
         if (trim($_GET['merchant_name']) != '') {
             $condition['company_name'] = ['like', '%' . $_GET['merchant_name'] . '%'];
         }
-
-        $merchant_list = $model_merchant->getMerchantList($condition, 100, 'available_predeposit desc,merchant_state asc,mchid desc', true);
+        $debt_total = 0;
+        $available_total = 0;
+        $merchant_list = $model_merchant->getMerchantList($condition, 200, 'available_predeposit desc,merchant_state asc,mchid desc', true);
         foreach ($merchant_list as $key => $merchant) {
-            $merchant_list[$key]['available_predeposit'] = number_format(($merchant['available_predeposit'] - $merchant['credit_bonus']),4,'.',',');
-            $merchant_list[$key]['credit_bonus'] = $merchant['credit_bonus'];
+            $mchid = $merchant['mchid'];
+            $available_predeposit = $merchant['available_predeposit'] - $merchant['credit_bonus'];
+            $merchant_list[$key]['available_predeposit'] = number_format($available_predeposit,4,'.',',');;
+            if(!in_array($mchid, $config['test_mchid']) && $merchant['merchant_state'] == 1) {
+                if($available_predeposit >= 0) {
+                    $available_total += $available_predeposit;
+                }else{
+                    $debt_total += $available_predeposit;
+                }
+            }
         }
+        $stats = ['available_total' => $available_total, 'debt_total' => $debt_total];
         $merchant_state_text = ['使用中', '已禁用'];
         Tpl::output('merchant_state_text', $merchant_state_text);
         Tpl::output('merchant_list', $merchant_list);
+        Tpl::output('stats', $stats);
         Tpl::output('page', $model_merchant->showpage('2'));
         Tpl::showpage('merchant.index');
     }

+ 12 - 4
admin/control/provider.php

@@ -33,7 +33,7 @@ class providerControl extends SystemControl
             ->on('store.store_id=refill_provider.store_id')
             ->where($condition)
             ->order('opened asc, name asc')
-            ->page(100)
+            ->page(200)
             ->select();
 
         $providers = [];
@@ -43,6 +43,7 @@ class providerControl extends SystemControl
         {
             $pid = $provider['provider_id'];
             $providers[$pid] = $provider;
+            $providers[$pid]['available_predeposit'] = 0;
             $account_id = intval($provider['account_id']);
             if($account_id > 0) {
                 $mid_pids[$account_id] = $pid;
@@ -50,6 +51,8 @@ class providerControl extends SystemControl
             }
         }
 
+        $debt_total = 0;
+        $available_total = 0;
         if(!empty($mids))
         {
             $member_data = Model('member')->field('member_id,available_predeposit')->where(['member_id' => ['in',$mids]])->select();
@@ -59,17 +62,22 @@ class providerControl extends SystemControl
                 if(array_key_exists($mid,$mid_pids)) {
                     $pid = $mid_pids[$mid];
                     $providers[$pid]['available_predeposit'] = $member['available_predeposit'];
-                } else {
-                    $providers[$pid]['available_predeposit'] = 0;
+                    if($providers[$pid]['opened'] != 1) continue;
+                    if($member['available_predeposit'] >= 0) {
+                        $available_total += $member['available_predeposit'];
+                    }else{
+                        $debt_total += $member['available_predeposit'];
+                    }
                 }
             }
         }
-
+        $stats = ['available_total' => $available_total, 'debt_total' => $debt_total];
         $opened_text = ['使用中', '已禁用'];
         $type_text = ['油卡', '手机充值卡', '增值业务'];
         Tpl::output('opened_text', $opened_text);
         Tpl::output('type_text', $type_text);
         Tpl::output('provider_list', $providers);
+        Tpl::output('stats', $stats);
         Tpl::output('show_page', $provider_model->showpage());
         Tpl::showpage('provider.index');
     }

+ 18 - 14
admin/templates/default/merchant.index.php

@@ -45,20 +45,24 @@ defined('InShopNC') or exit('Access Invalid!'); ?>
             </tbody>
         </table>
     </form>
-    <!--   <table class="table tb-type2" id="prompt">-->
-    <!--    <tbody>-->
-    <!--      <tr class="space odd">-->
-    <!--        <th colspan="12"><div class="title">-->
-    <!--            <h5>--><?php //echo $lang['nc_prompts'];?><!--</h5>-->
-    <!--            <span class="arrow"></span></div></th>-->
-    <!--      </tr>-->
-    <!--      <tr>-->
-    <!--        <td><ul>-->
-    <!--            <li>--><?php //echo $lang['store_help1'];?><!--</li>-->
-    <!--          </ul></td>-->
-    <!--      </tr>-->
-    <!--    </tbody>-->
-    <!--  </table>-->
+       <table class="table tb-type2" id="prompt">
+        <tbody>
+          <tr class="space odd">
+            <th colspan="12"><div class="title">
+                <h5>余额统计</h5>
+                <span class="arrow"></span></div></th>
+          </tr>
+          <tr>
+            <td>
+                <ul class="row_w">
+                    <li class="lineLi" style="color:#000;">总剩余: <?php echo ncPriceFormat($output['stats']['available_total']);?></li>
+                    <li class="lineLi" style="color:#000;">总欠款:<?php echo ncPriceFormat($output['stats']['debt_total']);?></li>
+                    <li class="lineLi" style="color:#000;">合计:<?php echo ncPriceFormat($output['stats']['available_total'] + $output['stats']['debt_total']);?></li>
+                </ul>
+            </td>
+          </tr>
+        </tbody>
+      </table>
     <form method="post" id="merchant_name_form">
         <input type="hidden" name="form_submit" value="ok"/>
         <a href="#" class="btns" id="close"><span>全部关闭机构</span></a>

+ 18 - 14
admin/templates/default/provider.index.php

@@ -88,20 +88,24 @@
             </tbody>
         </table>
     </form>
-    <!--   <table class="table tb-type2" id="prompt">-->
-    <!--    <tbody>-->
-    <!--      <tr class="space odd">-->
-    <!--        <th colspan="12"><div class="title">-->
-    <!--            <h5>--><?php //echo $lang['nc_prompts'];?><!--</h5>-->
-    <!--            <span class="arrow"></span></div></th>-->
-    <!--      </tr>-->
-    <!--      <tr>-->
-    <!--        <td><ul>-->
-    <!--            <li>--><?php //echo $lang['store_help1'];?><!--</li>-->
-    <!--          </ul></td>-->
-    <!--      </tr>-->
-    <!--    </tbody>-->
-    <!--  </table>-->
+       <table class="table tb-type2" id="prompt">
+        <tbody>
+          <tr class="space odd">
+            <th colspan="12"><div class="title">
+                <h5>上游余额统计</h5>
+                <span class="arrow"></span></div></th>
+          </tr>
+          <tr>
+            <td>
+                <ul class="row_w">
+                    <li class="lineLi" style="color:#000;">总剩余: <?php echo ncPriceFormat($output['stats']['available_total']);?></li>
+                    <li class="lineLi" style="color:#000;">总欠款:<?php echo ncPriceFormat($output['stats']['debt_total']);?></li>
+                    <li class="lineLi" style="color:#000;">合计:<?php echo ncPriceFormat($output['stats']['available_total'] + $output['stats']['debt_total']);?></li>
+                </ul>
+            </td>
+          </tr>
+        </tbody>
+      </table>
     <form method="post" id="merchant_name_form">
         <input type="hidden" name="form_submit" value="ok"/>
         <table class="table tb-type2">

+ 2 - 0
admin/templates/default/system.order.stats.php

@@ -74,6 +74,7 @@
                     <li class="lineLi" style="color:#000;">总计成功订单金额:<?php echo $output['total_stats']['notify_time']['success_refill_amounts_total'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计下游扣款金额:<?php echo $output['total_stats']['notify_time']['success_mch_amounts_toatl'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计上游扣款金额:<?php echo $output['total_stats']['notify_time']['success_channel_amounts_total'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计利润:<?php echo $output['total_stats']['notify_time']['profit_amounts_total'] ?? 0?></li>
                 </ul>
                 <ul>
                     <li>下单日期统计</li>
@@ -81,6 +82,7 @@
                     <li class="lineLi" style="color:#000;">总计成功订单金额:<?php echo $output['total_stats']['order_time']['success_refill_amounts_total'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计下游扣款金额:<?php echo $output['total_stats']['order_time']['success_mch_amounts_toatl'] ?? 0?></li>
                     <li class="lineLi" style="color:#000;">总计上游扣款金额:<?php echo $output['total_stats']['order_time']['success_channel_amounts_total'] ?? 0?></li>
+                    <li class="lineLi" style="color:#000;">总计利润:<?php echo $output['total_stats']['order_time']['profit_amounts_total'] ?? 0?></li>
                 </ul>
             </td>
           </tr>

+ 22 - 9
data/config/xyz/refill.ini.php

@@ -2542,31 +2542,31 @@ $guochuang_nation_phone = ['name' => 'guochuang_nation', 'store_id' => 121, 'qua
 
         ],
         4  => [
-            ['goods_id' => 7054, 'price' => 4.124, 'quality' => 2, 'card_type' => 'chinaunicom']
+            ['goods_id' => 7054, 'price' => 4.084, 'quality' => 2, 'card_type' => 'chinaunicom']
         ],
         5  => [
             ['goods_id' => 7055, 'price' => 5.305, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7055, 'price' => 5.155, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7055, 'price' => 5.105, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7055, 'price' => 5.255, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         6  => [
             ['goods_id' => 7056, 'price' => 6.306, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7056, 'price' => 6.186, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7056, 'price' => 6.126, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7056, 'price' => 6.2562, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         7  => [
             ['goods_id' => 7057, 'price' => 7.308, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7057, 'price' => 7.217, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7057, 'price' => 7.147, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7057, 'price' => 7.2569, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         8  => [
             ['goods_id' => 7058, 'price' => 8.308, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7058, 'price' => 8.248, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7058, 'price' => 8.168, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7058, 'price' => 8.2584, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         9  => [
             ['goods_id' => 7059, 'price' => 9.3105, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 7059, 'price' => 9.279, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7059, 'price' => 9.189, 'quality' => 2, 'card_type' => 'chinaunicom'],
             ['goods_id' => 7059, 'price' => 9.2592, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
@@ -4589,18 +4589,31 @@ $ruizhi_phone = ['name' => 'ruizhi', 'store_id' => 188,'qualitys' => '2',
         20 => [['goods_id' => 7594, 'price' => 20.34, 'quality' => 2, 'card_type' => 'chinamobile']],
         30 => [
             ['goods_id' => 7595, 'price' => 30.36, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7595, 'price' => 30.03, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         50 => [
-            ['goods_id' => 7596, 'price' => 50.025, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7596, 'price' => 50.4, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7596, 'price' => 50.05, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
         100 => [
             ['goods_id' => 7597, 'price' => 100.05, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7597, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7597, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinatelecom'],
         ],
         200 => [
             ['goods_id' => 7598, 'price' => 200.1, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7598, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7598, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinatelecom'],
         ],
-        300 => [['goods_id' => 7599, 'price' => 300.15, 'quality' => 2, 'card_type' => 'chinamobile']],
-        500 => [['goods_id' => 7600, 'price' => 500.25, 'quality' => 2, 'card_type' => 'chinamobile']]
+        300 => [
+            ['goods_id' => 7599, 'price' => 300.15, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7599, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 7599, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 7600, 'price' => 500.25, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 7600, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 

+ 1 - 1
docker/compose/xyz/conf/crontab/slave_root

@@ -18,4 +18,4 @@
 #0   8   *   *   *   sh /mnt/xyzshop/util/purge.sh
 1   0   *   *   *   php /var/www/html/crontab/index.php date merchant_nightime
 1   6   *   *   *   php /var/www/html/crontab/index.php date merchant_daytime
-#0   0    *   *   *   php /var/www/html/crontab/index.php date merchant_available
+0   0    *   *   *   php /var/www/html/crontab/index.php date merchant_available

+ 13 - 1
helper/refill/api/xyz/ruizhi/account.txt

@@ -15,4 +15,16 @@
 20005 全国移动100元
 20006 全国移动200元
 20007 全国移动300元
-20008 全国移动500元
+20008 全国移动500元
+
+2022.3.9新增联通 电信
+20011	全国联通30元
+20012	全国联通50元
+20013	全国联通100元
+20014	全国联通200元
+20015	全国联通300元
+
+20021	全国电信100元
+20022	全国电信200元
+20023	全国电信300元
+20024	全国电信500元

+ 14 - 1
helper/refill/api/xyz/ruizhi/config.php

@@ -25,7 +25,20 @@ class config
             200 => 20006,
             300 => 20007,
             500 => 20008
-        ]
+        ],
+        mtopcard\ChinaUnicomCard => [
+            30  => 20011,
+            50  => 20012,
+            100 => 20013,
+            200 => 20014,
+            300 => 20015,
+        ],
+        mtopcard\ChinaTelecomCard => [
+            100 => 20021,
+            200 => 20022,
+            300 => 20023,
+            500 => 20024
+        ],
     ];
     const ERRCODES = ['101', '102', '103', '104', '105', '106', '107', '108', '109', '100', '112', '115', '116', '117', '118', '119', '120'];
 }