Procházet zdrojové kódy

Merge branch 'raccount' into rprofit

stanley-king před 2 roky
rodič
revize
c36ac9d222

+ 10 - 10
data/config/xyz/refill.ini.php

@@ -526,21 +526,21 @@ $xc_phone = ['name' => 'xc', 'store_id' => 34, 'qualitys' => '4',
 
 $xunyin_phone = ['name' => 'xunyin', 'store_id' => 35,'qualitys' => '2',
     'amount' => [
-//        10 => [
+        10 => [
 //            ['goods_id' => 6438, 'price' => 10.01, 'quality' => 2, 'card_type' => 'chinamobile'],
-//            ['goods_id' => 6438, 'price' => 10.01, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6438, 'price' => 10.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 6438, 'price' => 10.01, 'quality' => 2, 'card_type' => 'chinatelecom']
-//        ],
-//        20 => [
+        ],
+        20 => [
 //            ['goods_id' => 6439, 'price' => 20.02, 'quality' => 2, 'card_type' => 'chinamobile'],
-//            ['goods_id' => 6439, 'price' => 20.02, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6439, 'price' => 20.2, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 6439, 'price' => 20.02, 'quality' => 2, 'card_type' => 'chinatelecom']
-//        ],
-//        30 => [
+        ],
+        30 => [
 //            ['goods_id' => 6440, 'price' => 30.03, 'quality' => 2, 'card_type' => 'chinamobile'],
-//            ['goods_id' => 6440, 'price' => 30.03, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 6440, 'price' => 30.24, 'quality' => 2, 'card_type' => 'chinaunicom'],
 //            ['goods_id' => 6440, 'price' => 29.03, 'quality' => 2, 'card_type' => 'chinatelecom']
-//        ],
+        ],
         50 => [
             ['goods_id' => 6441, 'price' => 50.05, 'quality' => 2, 'card_type' => 'chinamobile'],
             ['goods_id' => 6441, 'price' => 50.05, 'quality' => 2, 'card_type' => 'chinaunicom'],
@@ -6870,4 +6870,4 @@ $third_providers = [
 $config['third_providers'] = $third_providers;
 
 $config['auto_find_channels'] = true;
-$config['cancel_retry_time'] = [10120 => ["9:00",'10:00','11:00']];
+$config['cancel_retry_time'] = [10120 => ["9:00",'10:00','11:00']];

+ 1 - 1
data/logic/buy_virtual.logic.php

@@ -86,7 +86,7 @@ class buy_virtualLogic
      * @param int $member_id
      * @return array
      */
-    public function buyStep3($post, $member_id,$calc_vorder_amount = null,$merchant = false,$use_trans = true)
+    public function buyStep3($post, $member_id, $calc_vorder_amount = null, $merchant = false, $use_trans = true)
     {
         $fRefill = $merchant;
         $result = $this->getBuyStepData($post['goods_id'], $post['quantity'], $member_id, $fRefill);

+ 19 - 0
docker/compose/workcuda/database/docker-compose.yml

@@ -0,0 +1,19 @@
+version: "3.7"
+
+services:
+  mysql:
+    image: mysql:latest
+    ports:
+      - 3306:3306
+    volumes:
+      - /mnt/mysql/logs:/var/log/mysql
+      - /mnt/mysql/data:/var/lib/mysql
+      - /mnt/mysql/conf/my.cnf:/etc/my.cnf
+    container_name: docker-mysqld
+    restart: always
+    environment:
+      MYSQL_ROOT_PASSWORD: 55668899
+    deploy:
+      resources:
+        limits:
+          cpus: '16'

+ 2 - 2
docker/compose/workcuda/statcalc/docker-compose.yml

@@ -10,7 +10,7 @@ services:
       - /mnt/shoplog:/var/www/html/data/log
       - /mnt/stdata:/var/www/html/data/stdata
     container_name: "panda-mamount"
-    command: [ 'python','mamount_lack.py', '-h', '192.168.3.46', '-p', '6379' ]
+    command: [ 'python','mamount_lack.py', '-h', '192.168.3.226', '-p', '6379' ]
 
   mpratios:
     image: pycpu:3.7.10
@@ -21,4 +21,4 @@ services:
       - /mnt/shoplog:/var/www/html/data/log
       - /mnt/stdata:/var/www/html/data/stdata
     container_name: "panda-mpratios"
-    command: [ 'python','mprofit_ratio.py', '-h', '192.168.3.46', '-p', '6379' ]
+    command: [ 'python','mprofit_ratio.py', '-h', '192.168.3.226', '-p', '6379' ]

+ 1 - 1
docker/compose/workcuda/statwriter/docker-compose.yml

@@ -10,7 +10,7 @@ services:
       - /mnt/shoplog:/var/www/html/data/log
       - /mnt/stdata:/var/www/html/data/stdata
     container_name: "panda-qreader"
-    command: ['python','qreader.py','-h', '192.168.3.46', '-p', '6379']
+    command: ['python','qreader.py','-h', '192.168.3.226', '-p', '6379']
     deploy:
       resources:
         limits:

+ 14 - 19
helper/refill/RefillBase.php

@@ -26,8 +26,6 @@ use Swoole;
 class RefillBase
 {
     protected $mPolicy;
-
-    protected $mLimits = [];
     protected function __construct($policy)
     {
         $this->mPolicy = $policy;
@@ -303,7 +301,7 @@ class RefillBase
         $input['pd_pay'] = true;
 
         $logic_buy_virtual = Logic('buy_virtual');
-        $result = $logic_buy_virtual->buyStep3($input, $buyer_id, [$calc, 'calc_vorder_amount'], true,false);
+        $result = $logic_buy_virtual->buyStep3($input, $buyer_id, [$calc, 'calc_vorder_amount'], true, true);
 
         $mod_refill = Model('refill_order');
         if ($result['state'] === true)
@@ -725,29 +723,18 @@ class RefillBase
 
     public function query_net($order_id)
     {
-        $query_handler = function ($order_id, $order_info)
+        $query_handler = function ($order_id, $order_info, $state, $order_state, $chname)
         {
             $mod_refill = Model('refill_order');
-            $refill_info = $mod_refill->getOrderInfo(['order_id' => $order_id,'inner_status' => 0]);
-            $chname = $refill_info['channel_name'];
-
-            if($order_info['order_state'] == ORDER_STATE_PAY) {
+            if ($order_info['order_state'] == ORDER_STATE_PAY) {
                 $query_able = true;
-            }
-            else {
+            } else {
                 $query_able = false;
             }
 
             $can_try = false;
             if($query_able)
             {
-                if (empty($chname)) return [false, $can_try, $chname];
-
-                $provider = $this->mPolicy->provider($chname);
-                if(empty($provider)) return [false, $can_try, $chname];
-
-                [$state, $order_state] = $provider->query($refill_info);
-
                 if(!$state) {
                     QueueClient::async_push("QueryOrderNeterr",['order_id' => $order_id],30);
                     $neterr = true;
@@ -776,18 +763,26 @@ class RefillBase
                 util::monitor_netchk($chname,$neterr);
             }
 
-            return [true,$can_try,$chname];
+            return [true,$can_try];
         };
 
         $mod_order = Model('vr_order');
         $order_info = $mod_order->getOrderInfo(['order_id' => $order_id]);
         if (empty($order_info) || $order_info['order_state'] != ORDER_STATE_PAY) return false;
 
+        $mod_refill = Model('refill_order');
+        $refill_info = $mod_refill->getOrderInfo(['order_id' => $order_id,'inner_status' => 0]);
+        $chname = $refill_info['channel_name'];
+        $provider = $this->mPolicy->provider($chname);
+        if(empty($provider)) return false;
+
+        [$state, $order_state] = $provider->query($refill_info);
+
         try {
             $can_try = false;
             $tran = new trans_wapper($mod_order, 'query_net change order state trans');
             $order_info = $mod_order->getOrderInfo(['order_id' => $order_id], '*', true, true);
-            [$ret, $can_try, $chname] = $query_handler($order_id, $order_info);
+            [$ret, $can_try] = $query_handler($order_id, $order_info, $state, $order_state, $chname);
             $tran->commit();
             $trans_succ = true;
         }

+ 1 - 1
helper/refill/api/yl/yezi_hf/RefillCallBack.php

@@ -67,7 +67,7 @@ class RefillCallBack implements refill\IRefillCallBack
         }
         elseif ($status === 'CANCEL') {
             Model('refill_order')->edit($order_id, ['ch_trade_no' => $params['trade_no']]);
-            return [$order_id, false, false,true];
+            return [$order_id, false, true,true];
         }
         else {
             return [$order_id, false, false,false];

+ 1 - 1
helper/refill/policy/ctl_itemex.php

@@ -4,7 +4,7 @@ namespace refill;
 
 class ctl_itemex
 {
-    const feed_threshold = 10;
+    const feed_threshold = 2;
 
     private $mName;
     private $mCardType;

+ 4 - 4
helper/refill/policy/quaility.php

@@ -356,10 +356,10 @@ class Quality
             $cur_qualities = $all_qualities;
         }
 
-        if ($match_ratio) {
-            $all = $this->qualities($org_quality);
-            $cur_qualities = PolicyUtil::mixed_remove_last($org_quality, $cur_qualities, $all);
-        }
+//        if ($match_ratio) {
+//            $all = $this->qualities($org_quality);
+//            $cur_qualities = PolicyUtil::mixed_remove_last($org_quality, $cur_qualities, $all);
+//        }
 
         return [$cur_qualities,$match_ratio];
 

+ 2 - 1
test/TestSmartCard.php

@@ -20,7 +20,8 @@ class TestSmartCard extends TestCase
     public function testGenChannelCode()
     {
         $result = [];
-        $name_count = ['huanxishuyu' => 10];
+//        $name_count = ['huanxishuyu' => 10];
+        $name_count = ['乐猫数娱' => 25];
         foreach ($name_count as $name => $count)
         {
             $codes = $this->gen_code($name,$count);