瀏覽代碼

解决冲突文件

zhaoming 1 年之前
父節點
當前提交
9cb6a6153d

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

@@ -40,6 +40,10 @@ if(defined('COMPANY_NAME') && COMPANY_NAME === 'XYZ_COMPANY')
         '121.89.201.55'  => 'worker服务器',
         '121.89.223.81'  => 'worker服务器',
         '39.101.140.116' => 'worker服务器',
+        '47.92.156.48'   => 'YZ主库',
+        '39.98.58.225'   => 'YL主库',
+        '39.99.232.212'  => '后台+从库',
+        '47.92.103.87'   => '后台+从库'
     ];
 
     $config['test_mchid'] = [

+ 1 - 1
crontab/index.php

@@ -17,7 +17,7 @@ require_once(BASE_ROOT_PATH . '/helper/img_helper.php');
 require_once(BASE_ROOT_PATH . '/helper/exceptionex.php');
 require_once(BASE_ROOT_PATH . '/helper/notify_helper.php');
 
-if (php_sapi_name() == 'dpcli') {
+if (php_sapi_name() == 'cli') {
     $_GET['act'] = $_SERVER['argv'][1];
     $_GET['op'] = empty($_SERVER['argv'][2]) ? 'index' : $_SERVER['argv'][2];
 }

+ 1 - 1
data/api/xs/lib/XS.php

@@ -492,7 +492,7 @@ class XS extends XSComponent
 			if (function_exists('apc_fetch')) {
 				$cache = apc_fetch($cache_key);
 				$cache_write = 'apc_store';
-			} elseif (function_exists('xcache_get') && php_sapi_name() !== 'dpcli') {
+			} elseif (function_exists('xcache_get') && php_sapi_name() !== 'cli') {
 				$cache = xcache_get($cache_key);
 				$cache_write = 'xcache_set';
 			} elseif (function_exists('eaccelerator_get')) {

+ 1 - 1
data/api/xs/util/XSDataSource.class.php

@@ -31,7 +31,7 @@ abstract class XSDataSource
 	{
 		$this->type = $type;
 		$this->arg = $arg;
-		$this->inCli = php_sapi_name() === 'dpcli';
+		$this->inCli = php_sapi_name() === 'cli';
 		$this->init();
 	}
 

+ 5 - 0
data/config/xyz/refill.ini.php

@@ -9967,3 +9967,8 @@ $config['third_jumps'] = $third_jumps;
 
 #油需要发短信的机构
 $config['sms_mchids'] = [1090,10116];
+
+#风险流水号管理
+$config['risk_official_sn'] = [
+    'exclude_stores' => [192]
+];

+ 61 - 0
data/config/zy/refill.ini.php

@@ -2617,6 +2617,65 @@ $wogoudianzijuan_fy_phone = ['name' => 'wogoudianzijuan_fy', 'store_id' => 108,
     'official_sn' => true, 'refill_type' => 'api'];
 
 
+$wogoukongcfeiy_phone = ['name' => 'wogoukongcfeiy', 'store_id' => 107, 'qualitys' => '2',
+    'amount' => [
+        10 => [
+            ['goods_id' => 7169, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        20 => [
+            ['goods_id' => 7170, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        30 => [
+            ['goods_id' => 7171, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        50 => [
+            ['goods_id' => 7172, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        100 => [
+            ['goods_id' => 7173, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        200 => [
+            ['goods_id' => 7174, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        300 => [
+            ['goods_id' => 7175, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        500 => [
+            ['goods_id' => 7176, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$wangcxdzjfeiy_phone = ['name' => 'wangcxdzjfeiy', 'store_id' => 109, 'qualitys' => '2',
+    'amount' => [
+        10 => [
+            ['goods_id' => 7185, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        20 => [
+            ['goods_id' => 7186, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        30 => [
+            ['goods_id' => 7187, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        50 => [
+            ['goods_id' => 7188, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        100 => [
+            ['goods_id' => 7189, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        200 => [
+            ['goods_id' => 7190, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        300 => [
+            ['goods_id' => 7191, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ],
+        500 => [
+            ['goods_id' => 7192, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+
 $phone_providers = [
     ['name' => 'yezi_hf', 'cfg' => $yezi_hf_phone],
     ['name' => 'yezia', 'cfg' => $yezia_phone],
@@ -2702,6 +2761,8 @@ $phone_providers = [
     ['name' => 'shenzhoudzfy', 'cfg' => $shenzhoudzfy_phone],
     ['name' => 'guitongdianz', 'cfg' => $guitongdianz_phone],
     ['name' => 'wogoudianzijuan_fy', 'cfg' => $wogoudianzijuan_fy_phone],
+    ['name' => 'wogoukongcfeiy', 'cfg' => $wogoukongcfeiy_phone],
+    ['name' => 'wangcxdzjfeiy', 'cfg' => $wangcxdzjfeiy_phone],
 ];
 
 $config['phone_providers'] = $phone_providers;

+ 18 - 0
data/logic/queue.logic.php

@@ -1515,10 +1515,28 @@ class queueLogic
             return [$order_info,$refill_info];
         };
 
+        $in_exclude = function ($store_id)
+        {
+            $store_id = intval($store_id);
+            if($store_id <= 0) {
+                return false;
+            }
+
+            global $config;
+            $risk_official_sn = $config['risk_official_sn'] ?? [];
+            $exclude_stores = $risk_official_sn['exclude_stores'] ?? [];
+
+            return in_array($store_id,$exclude_stores);
+        };
+
         $store_id = intval($params['store_id']);
         $channel_name = $params['channel_name'];
         $order_id = intval($params['order_id']);
 
+        if($in_exclude($store_id)) {
+            return callback(true, '该通道不需要过滤');
+        }
+
         $ret = $msg_adder($order_id);
         if($ret === false) {
             return callback(false, 'OnRiskSN:没找到订单');

+ 1 - 1
docker/compose/dongpeng/acc/docker-compose.yml

@@ -14,7 +14,7 @@ services:
     container_name: "panda-nginx"
     command: [nginx,'-g','daemon off;']
     extra_hosts:
-      - "docker.hostip:172.17.0.1"
+      - "docker.hostip:172.19.0.3"
     deploy:
       resources:
         limits:

+ 6 - 6
docker/compose/dongpeng/admin/docker-compose.yml

@@ -10,8 +10,8 @@ services:
       - ../conf/etc/localtime:/etc/localtime:ro
       - ../conf/php/php.ini:/usr/local/etc/php/php.ini
       - ../conf/php/mch-spwan-start:/usr/local/bin/docker-spwan-start
-      - /mnt/upload:/var/www/html/data/upload
-      - /mnt/shoplog:/var/www/html/data/log
+      - /home/dongpeng/upload:/var/www/html/data/upload
+      - /home/dongpeng/shoplog:/var/www/html/data/log
     container_name: "panda-merchant"
     command: [docker-spwan-start]
     deploy:
@@ -26,14 +26,14 @@ services:
     volumes:
       - ../../../../:/var/www/html
       - ../conf/etc/localtime:/etc/localtime:ro
-      - ../conf/php/php.ini:/usr/local/etc/php/php.ini
+      - ../conf/php/php-debug.ini:/usr/local/etc/php/php.ini
       - ../conf/php-fpm/php-fpm.conf:/usr/local/etc/php-fpm.conf
-      - /mnt/upload:/var/www/html/data/upload
-      - /mnt/shoplog:/var/www/html/data/log
+      - /home/dongpeng/upload:/var/www/html/data/upload
+      - /home/dongpeng/shoplog:/var/www/html/data/log
     container_name: "panda-web"
     command: [php-fpm]
     extra_hosts:
-      - "docker.hostip:172.17.0.1"
+      - "docker.hostip:172.26.0.3"
     deploy:
       resources:
         limits:

+ 1 - 1
docker/compose/dongpeng/conf/nginx/nginx.conf

@@ -31,7 +31,7 @@ http
     {
     	listen       80;
         set  $folder_name /var/www/html;
-        server_name 192.168.3.46;
+        server_name 192.168.3.241;
         root $folder_name;
         index index.html index.php; 
 

+ 3 - 19
docker/compose/homecuda/acc/docker-compose.yml

@@ -1,10 +1,10 @@
 version: "3.7"
 
 services:
-  nginxsrv:
+  nginx:
     image: nginx:alpine
     ports:
-      - 80:80
+      - 8100:80
     volumes:
       - ../../../../:/var/www/html
       - ../conf/etc/localtime:/etc/localtime:ro
@@ -16,10 +16,8 @@ services:
     extra_hosts:
       - "docker.hostip:172.17.0.1"
 
-  mobilesrv:
+  mobile:
     image: php-zts:7.3.18
-    ports:
-      - 9100:9100
     volumes:
       - ../../../../:/var/www/html
       - ../conf/etc/localtime:/etc/localtime:ro
@@ -28,18 +26,4 @@ services:
       - /mnt/shoplog:/var/www/html/data/log
       - ../conf/php/mobile-spwan-start:/usr/local/bin/docker-spwan-start
     container_name: "panda-mobile"
-    command: ['docker-spwan-start']
-
-  vapisrv:
-    image: php-zts:7.3.18
-    ports:
-      - 9702:9100
-    volumes:
-      - ../../../../:/var/www/html
-      - ../conf/etc/localtime:/etc/localtime:ro
-      - ../conf/php/php.ini:/usr/local/etc/php/php.ini
-      - /mnt/upload:/var/www/html/data/upload
-      - /mnt/shoplog:/var/www/html/data/log
-      - ../conf/php/vapi-spwan-start:/usr/local/bin/docker-spwan-start
-    container_name: "panda-vapi"
     command: ['docker-spwan-start']

+ 1 - 1
docker/compose/homecuda/conf/nginx/nginx.conf

@@ -90,7 +90,7 @@ http
 
         location ~ /mobile/[/\w]+\.php$ {
             root           $folder_name;
-            fastcgi_pass   docker.hostip:9100;
+            fastcgi_pass   mobile:9000;
             fastcgi_index  index.php;
             fastcgi_param  SCRIPT_FILENAME  $folder_name$fastcgi_script_name;
             fastcgi_param  SIGN $http_sign;

+ 1 - 1
docker/compose/homecuda/conf/php/mobile-spwan-start

@@ -1,6 +1,6 @@
 #!/bin/sh
 set -e
-spawn-fcgi -a 0.0.0.0 -p 9100 -F 1 -f "php /var/www/html/mobile/mobile_run.php"
+spawn-fcgi -a 0.0.0.0 -p 9000 -F 1 -f "php /var/www/html/mobile/mobile_run.php"
 
 time=$(date "+%Y%m%d")
 

+ 76 - 0
helper/refill/api/zy/wangcxdzjfeiy/RefillCallBack.php

@@ -0,0 +1,76 @@
+<?php
+namespace refill\wangcxdzjfeiy;
+
+require_once(BASE_HELPER_RAPI_PATH . '/wangcxdzjfeiy/config.php');
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $input = $params;
+        unset($input['sign']);
+        $sign = $this->sign($input);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        ksort($params);
+
+        $body = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
+                if ($i == 0) {
+                    $body .= "{$k}" . "=" . urlencode($v);
+                } else {
+                    $body .= "&" . "{$k}" . "=" . urlencode($v);
+                }
+                $i++;
+            }
+        }
+
+        $body .= "&key=".config::KEY;
+        return md5($body);
+    }
+
+    public function notify($params)
+    {
+        $status = $params['state'];
+        $order_sn = $params['order_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 ($status === 'SUCCESS') {
+            $data['ch_trade_no'] = $params['trade_no'];
+            $data['official_sn'] = strtolower($params['official_sn']) == 'null' ? '' : $params['official_sn'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 'CANCEL') {
+            Model('refill_order')->edit($order_id, ['ch_trade_no' => $params['trade_no']]);
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 161 - 0
helper/refill/api/zy/wangcxdzjfeiy/RefillPhone.php

@@ -0,0 +1,161 @@
+<?php
+
+namespace refill\wangcxdzjfeiy;
+
+require_once(BASE_HELPER_RAPI_PATH . '/wangcxdzjfeiy/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, string $order_sn)
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'add';
+        $params['mchid'] = config::MCH_ID;
+        $params['cardno'] = $phone;
+        $params['amount'] = $amount;
+        $params['order_sn'] = $order_sn;
+        $params['notifyurl'] = config::NOTIFY_URL;
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $params = $this->req_params($card_no, $amount, $params['order_sn']);
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params , 'POST' , false , [] , $net_errno);
+
+        if (empty($resp)) {
+            return [false, '系统错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp ,true);
+            if (empty($resp)) {
+                return [false, '系统错误', true];
+            } elseif ($resp['code'] === 200) {
+                return [true, '', false];
+            } else {
+                return [false, $resp['message'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'query';
+        $params['mchid'] = config::MCH_ID;
+        $params['order_sn'] = $refill_info['order_sn'];
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::ORDER_URL, $params , 'POST');
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            }
+            elseif ($resp['code'] === 200)
+            {
+                $data = $resp['datas'];
+                if ($data['order_state'] == '40') {
+                    $save['ch_trade_no'] = $data['trade_no'];
+                    $save['official_sn'] = strtolower($resp['official_sn']) == 'null' ? '' : $resp['official_sn'];
+                    Model('refill_order')->edit($refill_info['order_id'], $save);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($data['order_state'] === '0') {
+                    Model('refill_order')->edit($refill_info['order_id'], ['ch_trade_no' => $data['trade_no']]);
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif (in_array($data['order_state'], ['10', '20', '30', '50'], true)) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $resp['message']];
+                }
+                return [true, $order_state];
+            }
+            elseif ($resp['code'] === 202 && (time() - $refill_info['commit_time'] >= 600))
+            {
+                return [true, ORDER_STATE_NOEXIST];
+            }
+            else
+            {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'balance';
+        $params['mchid'] = config::MCH_ID;
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::ORDER_URL, $params , 'POST');
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            } elseif ($resp['code'] === 200) {
+                return [true, ncPriceFormat($resp['datas']['balance'])];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        ksort($params);
+
+        $body = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
+                if ($i == 0) {
+                    $body .= "{$k}" . "=" . urlencode($v);
+                } else {
+                    $body .= "&" . "{$k}" . "=" . urlencode($v);
+                }
+                $i++;
+            }
+        }
+
+        $body .= "&key=".config::KEY;
+
+        return md5($body);
+    }
+}

+ 7 - 0
helper/refill/api/zy/wangcxdzjfeiy/api.txt

@@ -0,0 +1,7 @@
+https://admin.xyzshops.cn/merchant/#/login
+
+wangcxdzjfeiy
+hukyx_iu89
+
+10471
+1044766eba6255d784b62d77b48edb4c

+ 12 - 0
helper/refill/api/zy/wangcxdzjfeiy/config.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace refill\wangcxdzjfeiy;
+
+#wangcxdzjfeiy:旺宸讯(电子卷_非银)
+class config
+{
+    const ORDER_URL = 'https://www.xyzshops.cn/mobile/index.php';
+    const MCH_ID = 10471;
+    const KEY = '1044766eba6255d784b62d77b48edb4c';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_wangcxdzjfeiy.php";
+}

+ 76 - 0
helper/refill/api/zy/wogoukongcfeiy/RefillCallBack.php

@@ -0,0 +1,76 @@
+<?php
+namespace refill\wogoukongcfeiy;
+
+require_once(BASE_HELPER_RAPI_PATH . '/wogoukongcfeiy/config.php');
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $input = $params;
+        unset($input['sign']);
+        $sign = $this->sign($input);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        ksort($params);
+
+        $body = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
+                if ($i == 0) {
+                    $body .= "{$k}" . "=" . urlencode($v);
+                } else {
+                    $body .= "&" . "{$k}" . "=" . urlencode($v);
+                }
+                $i++;
+            }
+        }
+
+        $body .= "&key=".config::KEY;
+        return md5($body);
+    }
+
+    public function notify($params)
+    {
+        $status = $params['state'];
+        $order_sn = $params['order_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 ($status === 'SUCCESS') {
+            $data['ch_trade_no'] = $params['trade_no'];
+            $data['official_sn'] = strtolower($params['official_sn']) == 'null' ? '' : $params['official_sn'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 'CANCEL') {
+            Model('refill_order')->edit($order_id, ['ch_trade_no' => $params['trade_no']]);
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 161 - 0
helper/refill/api/zy/wogoukongcfeiy/RefillPhone.php

@@ -0,0 +1,161 @@
+<?php
+
+namespace refill\wogoukongcfeiy;
+
+require_once(BASE_HELPER_RAPI_PATH . '/wogoukongcfeiy/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, string $order_sn)
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'add';
+        $params['mchid'] = config::MCH_ID;
+        $params['cardno'] = $phone;
+        $params['amount'] = $amount;
+        $params['order_sn'] = $order_sn;
+        $params['notifyurl'] = config::NOTIFY_URL;
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $params = $this->req_params($card_no, $amount, $params['order_sn']);
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params , 'POST' , false , [] , $net_errno);
+
+        if (empty($resp)) {
+            return [false, '系统错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp ,true);
+            if (empty($resp)) {
+                return [false, '系统错误', true];
+            } elseif ($resp['code'] === 200) {
+                return [true, '', false];
+            } else {
+                return [false, $resp['message'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'query';
+        $params['mchid'] = config::MCH_ID;
+        $params['order_sn'] = $refill_info['order_sn'];
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::ORDER_URL, $params , 'POST');
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            }
+            elseif ($resp['code'] === 200)
+            {
+                $data = $resp['datas'];
+                if ($data['order_state'] == '40') {
+                    $save['ch_trade_no'] = $data['trade_no'];
+                    $save['official_sn'] = strtolower($resp['official_sn']) == 'null' ? '' : $resp['official_sn'];
+                    Model('refill_order')->edit($refill_info['order_id'], $save);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($data['order_state'] === '0') {
+                    Model('refill_order')->edit($refill_info['order_id'], ['ch_trade_no' => $data['trade_no']]);
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif (in_array($data['order_state'], ['10', '20', '30', '50'], true)) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $resp['message']];
+                }
+                return [true, $order_state];
+            }
+            elseif ($resp['code'] === 202 && (time() - $refill_info['commit_time'] >= 600))
+            {
+                return [true, ORDER_STATE_NOEXIST];
+            }
+            else
+            {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'balance';
+        $params['mchid'] = config::MCH_ID;
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::ORDER_URL, $params , 'POST');
+
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            } elseif ($resp['code'] === 200) {
+                return [true, ncPriceFormat($resp['datas']['balance'])];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        ksort($params);
+
+        $body = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
+                if ($i == 0) {
+                    $body .= "{$k}" . "=" . urlencode($v);
+                } else {
+                    $body .= "&" . "{$k}" . "=" . urlencode($v);
+                }
+                $i++;
+            }
+        }
+
+        $body .= "&key=".config::KEY;
+
+        return md5($body);
+    }
+}

+ 7 - 0
helper/refill/api/zy/wogoukongcfeiy/api.txt

@@ -0,0 +1,7 @@
+https://admin.xyzshops.cn/merchant/#/login
+
+wogoukongcfeiy
+esec_78oi
+
+10469
+966a2ce7f8f8dc2490410a527d79bc98

+ 12 - 0
helper/refill/api/zy/wogoukongcfeiy/config.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace refill\wogoukongcfeiy;
+
+#wogoukongcfeiy: 沃购 空充 非银
+class config
+{
+    const ORDER_URL = 'https://www.xyzshops.cn/mobile/index.php';
+    const MCH_ID = 10469;
+    const KEY = '966a2ce7f8f8dc2490410a527d79bc98';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_wogoukongcfeiy.php";
+}

+ 4 - 0
mobile/callback/refill_wangcxdzjfeiy.php

@@ -0,0 +1,4 @@
+<?php
+
+refill\util::push_notify('wangcxdzjfeiy',$_POST);
+echo ('SUCCESS');

+ 4 - 0
mobile/callback/refill_wogoukongcfeiy.php

@@ -0,0 +1,4 @@
+<?php
+
+refill\util::push_notify('wogoukongcfeiy',$_POST);
+echo ('SUCCESS');

+ 1 - 0
queue/index.php

@@ -12,6 +12,7 @@ if (!@include(BASE_CORE_PATH . '/lrlz.php')) exit('lrlz.php isn\'t exists!');
 
 require_once(BASE_ROOT_PATH . '/fooder.php');
 require_once(BASE_ROOT_PATH . '/helper/event_looper.php');
+require_once(BASE_CONFIG_PATH . CONFIG_PREFIX . '/refill.ini.php');
 
 if (empty($_SERVER['argv'][1]) || empty($_SERVER['argv'][2])) exit('parameter error');
 

+ 24 - 0
test/TestRefill.php

@@ -5221,6 +5221,30 @@ class TestRefill extends TestCase
         $provider = $this->getProvider('wogoudianzijuan_fy');
         $resp = $provider->add(13911129867, 4, 10, ['order_sn' => $this->make_sn()]);
     }
+
+    public function testWogoukongcfeiy_Balance()
+    {
+        $provider = $this->getProvider('wogoukongcfeiy');
+        [$succ, $val] = $provider->balance();
+    }
+
+    public function testWogoukongcfeiy_Add()
+    {
+        $provider = $this->getProvider("wogoukongcfeiy");
+        $resp = $provider->add(13581540213, 4, 10, ['order_sn' => $this->make_sn()]);
+    }
+
+    public function testWangcxdzjfeiy_Balance()
+    {
+        $provider = $this->getProvider('wangcxdzjfeiy');
+        [$succ, $val] = $provider->balance();
+    }
+
+    public function testWangcxdzjfeiy_Add()
+    {
+        $provider = $this->getProvider("wangcxdzjfeiy");
+        $resp = $provider->add(13911129867, 4, 10, ['order_sn' => $this->make_sn()]);
+    }
 }
 
 //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefill::testLoadBlack)( .*)?$/" --test-suffix TestRefill.php /var/www/html/test

+ 1 - 1
test/coroutine/udp_client.php

@@ -26,7 +26,7 @@ class Client
     {
         $cli = new swoole_client_coro(SWOOLE_SOCK_UDP);
         $ret = $cli->connect($this->ip, self::PORT);
-        $cli->send("sent by dpcli");
+        $cli->send("sent by cli");
 
         $cli2 = new swoole_client_coro(SWOOLE_SOCK_UDP);
         $ret = $cli2->connect($this->ip, self::PORT);

+ 1 - 1
test/coroutine/udp_tcp_timeout.php

@@ -78,7 +78,7 @@ class TestHttpServer {
 			//error_log(" tcp dpcli get rsp == " . print_r($ret, true) . PHP_EOL, 3, '/data/log/udp_timeout.log');
 		}
 		else{
-			error_log(" tcp dpcli timeout \n",3, '/data/log/udp_timeout.log');
+			error_log(" tcp cli timeout \n",3, '/data/log/udp_timeout.log');
 		}
 
 		$response ->end(" swoole response is ok");