Prechádzať zdrojové kódy

Merge branch 'ralb' of 39.97.239.116:gyfl/xyzshop into ralb

xiaoyu 3 rokov pred
rodič
commit
802d5cdd2c

+ 6 - 6
admin/templates/default/merchant.edit.php

@@ -66,12 +66,12 @@
                     <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == 1){ echo 'checked';}?> value="1" type="radio">无流水
                     <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == 5){ echo 'checked';}?> value="5" type="radio">有流水
                     <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == 3){ echo 'checked';}?> value="3" type="radio">卡密
-                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == 20){ echo 'checked';}?> value="20" type="radio">无流水 + 有流水
-                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == 21){ echo 'checked';}?> value="21" type="radio">有流水 + 无流水
-                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == 22){ echo 'checked';}?> value="22" type="radio">卡密 + 有流水
-                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == 23){ echo 'checked';}?> value="23" type="radio">卡密 + 无流水
-                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == 24){ echo 'checked';}?> value="24" type="radio">卡密 + 有流水 + 无流水
-                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == 25){ echo 'checked';}?> value="25" type="radio">卡密 + 无流水 + 有流水
+                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == 20){ echo 'checked';}?> value="20" type="radio">无流水+有流水
+                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == 21){ echo 'checked';}?> value="21" type="radio">有流水+无流水
+                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == 22){ echo 'checked';}?> value="22" type="radio">有流水+卡密
+                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == 23){ echo 'checked';}?> value="23" type="radio">无流水+卡密
+                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == 24){ echo 'checked';}?> value="24" type="radio">有流水+无流水+卡密
+                    <input name="oil_quality" <?php if($output['merchant']['oil_quality'] == 25){ echo 'checked';}?> value="25" type="radio">无流水+有流水+卡密
                 </td>
             </tr>
             <tr>

+ 12 - 1
data/config/win/refill.ini.php

@@ -182,6 +182,16 @@ $fetch_zanzan_oil = ['name' => 'fetch_zanzan', 'store_id' => 95, 'qualitys' => '
     ],
     'period' => [], 'refill_type' => 'fetch'];
 
+$fetch_lingzh_oil = ['name' => 'fetch_lingzh', 'store_id' => 96, 'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 6864, 'price' => 96.5, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        200 => [['goods_id' => 6865, 'price' => 193, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        500 => [['goods_id' => 6866, 'price' => 482.5, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        1000 => [['goods_id' => 6867, 'price' => 965, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        2000 => [['goods_id' => 6868, 'price' => 1930, 'quality' => 1, 'card_type' => 'sinopec,petrochina']]
+    ],
+    'period' => [], 'refill_type' => 'fetch'];
+
 $oil_providers = [
 //    ['name' => 'tianjt', 'cfg' => $tianjt_oil],
 //    ['name' => 'suhctm', 'cfg' => $suhctm_oil],
@@ -198,7 +208,8 @@ $oil_providers = [
     ['name' => 'feinimoshu', 'cfg' => $feinimoshu_oil],
     ['name' => 'xiaoniu', 'cfg' => $xiaoniu_oil],
     ['name' => 'yingdian', 'cfg' => $yingdian_oil],
-    ['name' => 'fetch_zanzan', 'cfg' => $fetch_zanzan_oil]
+    ['name' => 'fetch_zanzan', 'cfg' => $fetch_zanzan_oil],
+    ['name' => 'fetch_lingzh', 'cfg' => $fetch_lingzh_oil]
 ];
 $config['oil_providers'] = $oil_providers;
 

+ 12 - 1
data/config/xyz/refill.ini.php

@@ -182,6 +182,16 @@ $fetch_zanzan_oil = ['name' => 'fetch_zanzan', 'store_id' => 95, 'qualitys' => '
     ],
     'period' => [], 'refill_type' => 'fetch'];
 
+$fetch_lingzh_oil = ['name' => 'fetch_lingzh', 'store_id' => 96, 'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 6864, 'price' => 96.5, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        200 => [['goods_id' => 6865, 'price' => 193, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        500 => [['goods_id' => 6866, 'price' => 482.5, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        1000 => [['goods_id' => 6867, 'price' => 965, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        2000 => [['goods_id' => 6868, 'price' => 1930, 'quality' => 1, 'card_type' => 'sinopec,petrochina']]
+    ],
+    'period' => [], 'refill_type' => 'fetch'];
+
 $oil_providers = [
 //    ['name' => 'tianjt', 'cfg' => $tianjt_oil],
 //    ['name' => 'suhctm', 'cfg' => $suhctm_oil],
@@ -198,7 +208,8 @@ $oil_providers = [
     ['name' => 'feinimoshu', 'cfg' => $feinimoshu_oil],
     ['name' => 'xiaoniu', 'cfg' => $xiaoniu_oil],
     ['name' => 'yingdian', 'cfg' => $yingdian_oil],
-    ['name' => 'fetch_zanzan', 'cfg' => $fetch_zanzan_oil]
+    ['name' => 'fetch_zanzan', 'cfg' => $fetch_zanzan_oil],
+    ['name' => 'fetch_lingzh', 'cfg' => $fetch_lingzh_oil]
 ];
 $config['oil_providers'] = $oil_providers;
 

+ 12 - 1
data/config/xyzadm/refill.ini.php

@@ -182,6 +182,16 @@ $fetch_zanzan_oil = ['name' => 'fetch_zanzan', 'store_id' => 95, 'qualitys' => '
     ],
     'period' => [], 'refill_type' => 'fetch'];
 
+$fetch_lingzh_oil = ['name' => 'fetch_lingzh', 'store_id' => 96, 'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 6864, 'price' => 96.5, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        200 => [['goods_id' => 6865, 'price' => 193, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        500 => [['goods_id' => 6866, 'price' => 482.5, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        1000 => [['goods_id' => 6867, 'price' => 965, 'quality' => 1, 'card_type' => 'sinopec,petrochina']],
+        2000 => [['goods_id' => 6868, 'price' => 1930, 'quality' => 1, 'card_type' => 'sinopec,petrochina']]
+    ],
+    'period' => [], 'refill_type' => 'fetch'];
+
 $oil_providers = [
 //    ['name' => 'tianjt', 'cfg' => $tianjt_oil],
 //    ['name' => 'suhctm', 'cfg' => $suhctm_oil],
@@ -198,7 +208,8 @@ $oil_providers = [
     ['name' => 'feinimoshu', 'cfg' => $feinimoshu_oil],
     ['name' => 'xiaoniu', 'cfg' => $xiaoniu_oil],
     ['name' => 'yingdian', 'cfg' => $yingdian_oil],
-    ['name' => 'fetch_zanzan', 'cfg' => $fetch_zanzan_oil]
+    ['name' => 'fetch_zanzan', 'cfg' => $fetch_zanzan_oil],
+    ['name' => 'fetch_lingzh', 'cfg' => $fetch_lingzh_oil]
 ];
 $config['oil_providers'] = $oil_providers;
 

+ 42 - 0
helper/refill/api/xyz/fetch_lingzh/RefillCallBack.php

@@ -0,0 +1,42 @@
+<?php
+
+
+namespace refill\fetch_lingzh;
+
+require_once(BASE_HELPER_RAPI_PATH . '/fetch_lingzh/config.php');
+
+
+use refill;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        return true;
+    }
+
+    public function notify($params)
+    {
+        $order_sn = $params['order_sn'];
+        $state = $params['state'];
+        $official_sn = $params['official_sn'] ?? '';
+
+
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+        $order_id = $order_info['order_id'];
+
+        if ($state === 'SUCCESS') {
+            Model('refill_order')->edit($order_id, ['official_sn' => $official_sn]);
+            return [$order_id, true, false,true];
+        }
+        elseif ($state === 'CANCEL') {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 51 - 0
helper/refill/api/xyz/fetch_lingzh/RefillOil.php

@@ -0,0 +1,51 @@
+<?php
+
+namespace refill\fetch_lingzh;
+
+require_once(BASE_HELPER_RAPI_PATH . '/fetch_lingzh/config.php');
+
+use refill;
+
+class RefillOil extends refill\IRefillOil
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $mod_fetch = Model('fetch_order');
+        $count = $mod_fetch->store_order_count($this->store_id());
+        return [config::PROCESS_ABILITY >= $count, '',false];
+    }
+
+    public function query($refill_info)
+    {
+        $order_sn = $refill_info['order_sn'];
+        $store_id = $this->store_id();
+
+        $mod_fetch = Model('fetch_order');
+        $order = $mod_fetch->order_info(['order_sn' => $order_sn,'store_id' => $store_id],'*',true);
+        if(empty($order)) {
+            return [true, ORDER_STATE_NOEXIST];
+        }
+
+        $fetch_status = intval($order['fetch_status']);
+        $fetch_result = $order['fetch_result'];
+        $official_sn = $order['official_sn'];
+
+        if ($fetch_status == 0) {
+            $order_state = ORDER_STATE_CANCEL;
+        } elseif ($fetch_status == 1 || $fetch_status == 2) {
+            $order_state = ORDER_STATE_SEND;
+        } elseif ($fetch_result == "SUCCESS") {
+            $order_state = ORDER_STATE_SUCCESS;
+            Model('refill_order')->edit($refill_info['order_id'], ['official_sn' => $official_sn]);
+        } else {
+            $order_state = ORDER_STATE_CANCEL;
+        }
+
+        return [true, $order_state];
+    }
+}

+ 9 - 0
helper/refill/api/xyz/fetch_lingzh/config.php

@@ -0,0 +1,9 @@
+<?php
+
+
+namespace refill\fetch_lingzh;
+
+class config
+{
+    const PROCESS_ABILITY = 100;
+}

+ 9 - 8
helper/refill/policy/lingzh/quality_ploy.php

@@ -29,10 +29,10 @@ class quality_ploy extends Quality
             self::OilSN_NONE_HAS => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180],
             self::OilSN_HAS_NONE => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180],
 
-            self:: OIL_CARDKEY_SN        => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180],
-            self:: OIL_CARDKEY_SNNONE    => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180],
-            self:: OIL_CARDKEY_SN_SNNONE => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180],
-            self:: OIL_CARDKEY_SNNONE_SN => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180]
+            self:: OIL_SN_CARDKEY => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180],
+            self:: OIL_SNNONE_CARDKEY => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180],
+            self:: OIL_SN_SNNONE_CARDKEY => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180],
+            self:: OIL_SNNONE_SN_CARDKEY => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180]
         ];
 
         //增加组合通道的时候,注意增加时间控制
@@ -55,10 +55,11 @@ class quality_ploy extends Quality
 
             self::OilSN_NONE_HAS => [self::OilWithoutSN, self::OilWithSN],
             self::OilSN_HAS_NONE => [self::OilWithSN, self::OilWithoutSN],
-            self::OIL_CARDKEY_SN => [self::OilCardKey, self::OilWithSN],
-            self::OIL_CARDKEY_SNNONE => [self::OilCardKey, self::OilWithoutSN],
-            self::OIL_CARDKEY_SN_SNNONE => [self::OilCardKey, self::OilWithSN, self::OilWithoutSN],
-            self::OIL_CARDKEY_SNNONE_SN => [self::OilCardKey, self::OilWithoutSN, self::OilWithSN]
+
+            self::OIL_SN_CARDKEY => [self::OilWithSN,self::OilCardKey],
+            self::OIL_SNNONE_CARDKEY => [self::OilWithoutSN,self::OilCardKey],
+            self::OIL_SN_SNNONE_CARDKEY => [self::OilWithSN, self::OilWithoutSN,self::OilCardKey],
+            self::OIL_SNNONE_SN_CARDKEY => [self::OilWithoutSN, self::OilWithSN,self::OilCardKey]
         ];
     }
 }

+ 4 - 7
helper/refill/policy/mchoilctl.php

@@ -27,16 +27,13 @@ class mchoilctl
             $quality = intval($item['oil_quality']);
             $time_out = $item['time_out'];
 
-            if($quality == Quality::OilWithoutSN || $quality == Quality::OilCardKey || $quality == Quality::OilWithSN ) {
+            if ($quality == Quality::OilWithoutSN || $quality == Quality::OilCardKey || $quality == Quality::OilWithSN) {
 
-            }
-            elseif ($quality == Quality::OilSN_NONE_HAS || $quality == Quality::OilSN_HAS_NONE) {
+            } elseif ($quality == Quality::OilSN_NONE_HAS || $quality == Quality::OilSN_HAS_NONE) {
 
-            }
-            elseif ($quality == Quality::OIL_CARDKEY_SN || $quality == Quality::OIL_CARDKEY_SNNONE || $quality == Quality::OIL_CARDKEY_SN_SNNONE || $quality == Quality::OIL_CARDKEY_SNNONE_SN) {
+            } elseif ($quality == Quality::OIL_SN_CARDKEY || $quality == Quality::OIL_SNNONE_CARDKEY || $quality == Quality::OIL_SN_SNNONE_CARDKEY || $quality == Quality::OIL_SNNONE_SN_CARDKEY) {
 
-            }
-            else {
+            } else {
                 $quality = Quality::OilSN_NONE_HAS;
             }
 

+ 10 - 5
helper/refill/policy/quaility.php

@@ -31,10 +31,10 @@ class Quality
 
     const OilSN_NONE_HAS   = 20;
     const OilSN_HAS_NONE   = 21;
-    const OIL_CARDKEY_SN        = 22;
-    const OIL_CARDKEY_SNNONE    = 23;
-    const OIL_CARDKEY_SN_SNNONE = 24;
-    const OIL_CARDKEY_SNNONE_SN = 25;
+    const OIL_SN_CARDKEY        = 22;
+    const OIL_SNNONE_CARDKEY    = 23;
+    const OIL_SN_SNNONE_CARDKEY = 24;
+    const OIL_SNNONE_SN_CARDKEY = 25;
 
     protected $mMchPhonectl;
     protected $mMchoilctl;
@@ -177,7 +177,12 @@ class Quality
     private function calc_phone_quality($qualities,$fMixed, $cur_quality, $times, $used_time, $time_out, $max_times, $mchid)
     {
         $left_time = $time_out - $used_time;
-        if($left_time <= 0 || $max_times <= $times) return [];
+        if(!$fMixed)
+        {
+            if($left_time <= 0 || $max_times <= $times) {
+                return [];
+            }
+        }
 
         Log::record("calc_quality begin qualities= " . implode(',',$qualities),Log::DEBUG);
         $times_checker = function($qualities, $times)

+ 14 - 14
helper/refill/policy/xyz/quality_ploy.php

@@ -15,12 +15,12 @@ class quality_ploy extends Quality
             self::Quick => ['retry_times' => 10, 'retry_timeout' => 120, 'per_secs' => 80],
             self::CardKey => ['retry_times' => 10, 'retry_timeout' => 120, 'per_secs' => 80],
 
-            self::ThirdShop => ['retry_times' => 1, 'retry_timeout' => 900, 'per_secs' => 600],
-            self::SlowTwentyFour => ['retry_times' => 10, 'retry_timeout' => 86400, 'per_secs' => 86400],
-            self::SlowSix => ['retry_times' => 1, 'retry_timeout' => 21600, 'per_secs' => 21600],
-            self::SlowTwo => ['retry_times' => 1, 'retry_timeout' => 7200, 'per_secs' => 7200],
-            self::SlowFortyEight => ['retry_times' => 1, 'retry_timeout' => 172800, 'per_secs' => 172800 - 1800],
-            self::SlowSeventyTwo => ['retry_times' => 1, 'retry_timeout' => 172800, 'per_secs'  => 259200 - 1800],
+            self::ThirdShop => ['retry_times' => 10, 'retry_timeout' => 900, 'per_secs' => 600],
+            self::SlowTwentyFour => ['retry_times' => 10, 'retry_timeout' => 86400, 'per_secs' => 86400 - 1800],
+            self::SlowSix => ['retry_times' => 10, 'retry_timeout' => 21600, 'per_secs' => 21600 - 900],
+            self::SlowTwo => ['retry_times' => 10, 'retry_timeout' => 7200, 'per_secs' => 7200 - 600],
+            self::SlowFortyEight => ['retry_times' => 10, 'retry_timeout' => 172800, 'per_secs' => 172800 - 1800],
+            self::SlowSeventyTwo => ['retry_times' => 10, 'retry_timeout' => 172800, 'per_secs' => 259200 - 1800],
 
             self::SlowNormal => ['retry_times' => 60, 'retry_timeout' => 7200, 'per_secs' => 180],
             self::ThirdNormal => ['retry_times' => 60, 'retry_timeout' => 900, 'per_secs' => 180],
@@ -33,10 +33,10 @@ class quality_ploy extends Quality
             self::OilSN_NONE_HAS => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180],
             self::OilSN_HAS_NONE => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180],
 
-            self:: OIL_CARDKEY_SN        => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180],
-            self:: OIL_CARDKEY_SNNONE    => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180],
-            self:: OIL_CARDKEY_SN_SNNONE => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180],
-            self:: OIL_CARDKEY_SNNONE_SN => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180]
+            self:: OIL_SN_CARDKEY        => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180],
+            self:: OIL_SNNONE_CARDKEY    => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180],
+            self:: OIL_SN_SNNONE_CARDKEY => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180],
+            self:: OIL_SNNONE_SN_CARDKEY => ['retry_times' => 65, 'retry_timeout' => 1800, 'per_secs' => 180]
         ];
 
         //增加组合通道的时候,注意增加时间控制
@@ -62,10 +62,10 @@ class quality_ploy extends Quality
             self::OilSN_NONE_HAS => [self::OilWithoutSN, self::OilWithSN],
             self::OilSN_HAS_NONE => [self::OilWithSN, self::OilWithoutSN],
 
-            self::OIL_CARDKEY_SN => [self::OilCardKey, self::OilWithSN],
-            self::OIL_CARDKEY_SNNONE => [self::OilCardKey, self::OilWithoutSN],
-            self::OIL_CARDKEY_SN_SNNONE => [self::OilCardKey, self::OilWithSN, self::OilWithoutSN],
-            self::OIL_CARDKEY_SNNONE_SN => [self::OilCardKey, self::OilWithoutSN, self::OilWithSN]
+            self::OIL_SN_CARDKEY => [self::OilWithSN,self::OilCardKey],
+            self::OIL_SNNONE_CARDKEY => [self::OilWithoutSN,self::OilCardKey],
+            self::OIL_SN_SNNONE_CARDKEY => [self::OilWithSN, self::OilWithoutSN,self::OilCardKey],
+            self::OIL_SNNONE_SN_CARDKEY => [self::OilWithoutSN, self::OilWithSN,self::OilCardKey]
         ];
     }
 }