stanley-king 4 år sedan
förälder
incheckning
eb8c10abcc

+ 6 - 5
admin/control/merchant.php

@@ -477,7 +477,7 @@ class merchantControl extends SystemControl
         }
 
         //充值申请列表
-        $evidence_list = $model_merchant->getRefillEvidence($condition, 20, '*', 'add_time desc');
+        $evidence_list = $model_merchant->getRefillEvidence($condition, 20, '*,member.available_predeposit', 'refill_evidence.add_time desc');
         $status_text = ['申请中', '已通过', '已驳回'];
         $operation_text = ['未预存', '已预存'];
         Tpl::output('evidence_list', $evidence_list);
@@ -528,9 +528,10 @@ class merchantControl extends SystemControl
             $apply_id = $_GET['apply_id'];
             if (!empty($apply_id)) {
                 $model_merchant = Model('merchant');
-                $evidence_info = $model_merchant->getRefillEvidenceInfo(['apply_id' => $apply_id], '*');
+                $evidence_info = $model_merchant->getRefillEvidenceInfo(['apply_id' => $apply_id], '*,member.available_predeposit');
                 Tpl::output('apply_id', $apply_id);
                 Tpl::output('amount', $evidence_info['amount']);
+                Tpl::output('available_predeposit', $evidence_info['available_predeposit']);
             }
             Tpl::showpage('recharge.add');
         }
@@ -611,7 +612,8 @@ class merchantControl extends SystemControl
             $data['pdr_sn'] = $order_sn;
             $data['lg_desc'] = $memo;
             $model_pd->changePd($admin_act, $data);
-            $model_merchant->editRefillEvidence(['apply_id' => $apply_id], ['is_operation' => 2]);
+            $after_available = ncPriceFormat($available_predeposit + $evidence_info['amount']);
+            $model_merchant->editRefillEvidence(['apply_id' => $apply_id], ['is_operation' => 2 , 'after_available' => $after_available]);
             $trans->commit();
             $this->log($log_msg, 1);
             return $evidence_info['mchid'];
@@ -749,7 +751,7 @@ class merchantControl extends SystemControl
         $type = $_GET['type'];
         $mod_order = Model('vr_order');
         $order_info = $mod_order->getOrderInfo(['order_id' => $order_id]);
-        if((time() - $order_info['order_time']) > 3600)
+        if((time() - $order_info['order_time']) < 3600)
         {
             showMessage('订单时间未超过1小时', 'index.php?act=merchant&op=refill_order');
         }
@@ -850,7 +852,6 @@ class merchantControl extends SystemControl
         $phone_items = $mod_prov->getProviderList(['type' => 2]);
         $phone_items = $name_val_row($phone_items);
         $phone_inserts = $match($phones,$phone_items);
-
         $inserter($mod_prov,1,$oil_inserts);
         $inserter($mod_prov,2,$phone_inserts);
     }

+ 8 - 0
admin/templates/default/merchant.refill.evidence_list.php

@@ -61,6 +61,7 @@
                 <th>申请编号</th>
                 <th>机构名称</th>
                 <th>申请金额</th>
+                <th>申请后余额</th>
                 <th class="align-center">转账银行开户人姓名</th>
                 <th class="align-center">转账银行名称</th>
                 <th class="align-center">申请状态</th>
@@ -77,6 +78,13 @@
                         <td><?php echo $v['apply_id']; ?></td>
                         <td><?php echo $v['mch_name']; ?></td>
                         <td><?php echo $v['amount']*100%100==0 ? intval($v['amount']) : $v['amount']; ?> (<?php echo $v['amount']>=10000 ? $v['amount']/10000 .'万' : $v['amount'] . '元';?>)</td>
+                        <td>
+                            <?php if ($v['is_operation'] == 1 && $v['status'] !=3 ){
+                                echo ncPriceFormat($v['available_predeposit'] + $v['amount']);
+                            }else{
+                                echo  $v['after_available'] == 0 ? '/' :  $v['after_available'];
+                            }?>
+                        </td>
                         <td class="align-center"><?php echo $v['bank_username']; ?></td>
                         <td class="align-center"><?php echo $v['bank_name']; ?></td>
                         <td class="align-center">

+ 5 - 0
admin/templates/default/recharge.add.php

@@ -26,6 +26,11 @@
             <input type="hidden" name="apply_id" id="apply_id" value="<?php echo $output['apply_id'];?>"/></td>
           <td class="vatop tips"></td>
         </tr>
+        <tr id="tr_memberinfo">
+            <td colspan="2" style="font-weight:bold;" id="td_memberinfo">
+                当前余额为:<?php echo $output['available_predeposit']?>,预存后余额为:<?php echo ncPriceFormat($output['available_predeposit'] + $output['amount'])?>。
+            </td>
+        </tr>
         <tr>
           <td colspan="2" class="required">增减类型:</label></td>
         </tr>

+ 12 - 2
data/config/prod/refill.ini.php

@@ -157,7 +157,7 @@ $weit_phone = ['name' => 'weit', 'store_id' => 18, 'card_type' => ['chinaunicom'
         300 => ['goods_id' => 6335, 'price' => 285],
         500 => ['goods_id' => 6336, 'price' => 475]], 'official_sn' => true, 'refill_type' => 'api'];
 
-$afand_phone = ['name' => 'afand', 'store_id' => 26, 'card_type' => ['chinamobile', 'chinaunicom', 'chinatelecom'],
+$afand_phone = ['name' => 'afand', 'store_id' => 26, 'card_type' => ['chinaunicom', 'chinatelecom'],
     'amount' => [
         30 => ['goods_id' => 6374, 'price' => 28.5],
         50 => ['goods_id' => 6375, 'price' => 47.5],
@@ -166,6 +166,15 @@ $afand_phone = ['name' => 'afand', 'store_id' => 26, 'card_type' => ['chinamobil
         300 => ['goods_id' => 6378, 'price' => 285],
         500 => ['goods_id' => 6379, 'price' => 475]], 'official_sn' => true, 'refill_type' => 'api'];
 
+$afandeng_phone = ['name' => 'afandeng', 'store_id' => 27, 'card_type' => ['chinamobile'],
+    'amount' => [
+        30 => ['goods_id' => 6380, 'price' => 28.5],
+        50 => ['goods_id' => 6381, 'price' => 47.5],
+        100 => ['goods_id' => 6382, 'price' => 95],
+        200 => ['goods_id' => 6383, 'price' => 190],
+        300 => ['goods_id' => 6384, 'price' => 285],
+        500 => ['goods_id' => 6385, 'price' => 475]], 'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
     ['name' => 'beixt', 'cfg' => $beixt_phone, 'opened' => false, 'sort' => 1],
     ['name' => 'bxtwt', 'cfg' => $bxtwt_phone, 'opened' => false, 'sort' => 2],
@@ -175,5 +184,6 @@ $phone_providers = [
     ['name' => 'yifa', 'cfg' => $yifa_phone, 'opened' => false, 'sort' => 5],
     ['name' => 'jiec', 'cfg' => $jiec_phone, 'opened' => false, 'sort' => 1],
     ['name' => 'weit', 'cfg' => $weit_phone, 'opened' => false, 'sort' => 1],
-    ['name' => 'afand', 'cfg' => $afand_phone, 'opened' => false, 'sort' => 1]];
+    ['name' => 'afand', 'cfg' => $afand_phone, 'opened' => false, 'sort' => 1],
+    ['name' => 'afandeng', 'cfg' => $afandeng_phone, 'opened' => false, 'sort' => 1]];
 $config['phone_providers'] = $phone_providers;

+ 2 - 2
data/model/merchant.model.php

@@ -58,14 +58,14 @@ class merchantModel extends Model
 
     public function getRefillEvidence($condition, $pagesize = '', $field = '*', $order = '', $limit = '')
     {
-        $list = $this->table('refill_evidence')->field($field)->where($condition)->page($pagesize)->order($order)->limit($limit)->select();
+        $list = $this->table('refill_evidence,member')->join('inner')->on('member.member_id=refill_evidence.member_id')->field($field)->where($condition)->page($pagesize)->order($order)->limit($limit)->select();
         if (empty($list)) return [];
         return $list;
     }
 
     public function getRefillEvidenceInfo($condition, $field = '*')
     {
-        $result = $this->table('refill_evidence')->where($condition)->field($field)->find();
+        $result = $this->table('refill_evidence,member')->join('inner')->on('member.member_id=refill_evidence.member_id')->where($condition)->field($field)->find();
         return $result;
     }
 

+ 154 - 0
helper/fcgi_server.php

@@ -0,0 +1,154 @@
+<?php
+
+/**
+ * Created by PhpStorm.
+ * User: stanley-king
+ * Date: 16/3/10
+ * Time: 下午9:08
+ */
+
+require_once (BASE_ROOT_PATH . '/mobile/index.php');
+require_once (BASE_ROOT_PATH . '/helper/area_helper.php');
+require_once (BASE_CORE_PATH . '/framework/function/http.php');
+
+class fcgi_server
+{
+    static private $stInstance = NULL;
+    static public function instance()
+    {
+        if(self::$stInstance == NULL) {
+            self::$stInstance = new fcgi_server();
+        }
+        return self::$stInstance;
+    }
+
+    private function is_exclude($file)
+    {
+        static $exfiles = ['web_wxnotify.php',
+            'wxnotify.php','pub_wxnotify.php','alipay_notify_url.php','dispatch_notify.php','kdniao_notify.php',
+            'cmbpay_notify.php','cmbpay_sign.php','wxauthor.php','api/wxLogin/index.php','api/wxLogin/callback.php',
+            'signature.php',
+            'refill_tianjt.php','refill_suhctm.php','refill_suhcpdd.php','refill_gftd.php',
+            'refill_beixt.php','refill_bxtwt.php','refill_bjb.php','refill_xyz.php',
+            'refill_zzx.php','refill_inner.php','refill_jiec.php','refill_yifa.php',
+            'bridge_shr.php','refill_weit.php','refill_tianx.php','refill_afand.php',
+            'refill_afandeng.php'
+        ];
+        $path = BASE_ROOT_PATH . '/mobile/';
+        $file = str_replace($path,'',$file);
+
+        return in_array($file,$exfiles);
+    }
+
+    private function clear_global()
+    {
+        $_SESSION = [];
+        $_COOKIE = [];
+        $_POST = [];
+        $_GET = [];
+    }
+
+    public function handle_error($level, $message, $file, $line)
+    {
+        if($level == E_NOTICE) return;
+        $trace = "handle_error: level={$level},msg={$message} file={$file},line={$line}\n";
+        $backtrace = debug_backtrace();
+        foreach ($backtrace as $item) {
+            $trace .= "{$item['file']}\t{$item['line']}\t{$item['function']}\n";
+        }
+
+        Log::record($trace,Log::ERR);
+    }
+
+    public function run_looper()
+    {
+        Log::record(__FUNCTION__,Log::DEBUG);
+        DFAFilter::instance();
+        area_helper::instance();
+        set_error_handler([$this, 'handle_error']);
+
+        Log::record('Waiting......',Log::DEBUG);
+        while(($ret = fcgi_accept()) >= 0)
+        {
+            $start = microtime(true);
+
+            ob_start();
+            $this->clear_global();
+            performance_helper::clear();
+            http_header::instance()->start();
+
+            try
+            {
+                Log::start_sql_log();
+                init_request();
+                init_cookie($_SERVER['HTTP_COOKIE']);
+                $file = request_helper::script_file();
+
+                if(file_exists($file))
+                {
+                    if(defined('CROSS_DOAMIN') && CROSS_DOAMIN == true) {
+                        $host = 'http://localhost:3333';
+                        fcgi_header("Content-Type: text/html; charset=UTF-8");
+                        fcgi_header("Access-Control-Allow-Credentials: true");
+                        fcgi_header("Access-Control-Allow-Origin: {$host}");
+                        fcgi_header('Access-Control-Allow-Methods: GET, POST, PUT,DELETE,PATCH');
+                    }
+
+                    if(self::is_exclude($file)) {
+                        Log::record("Call {$file}",Log::DEBUG);
+                        include $file;
+                    }
+                    else
+                    {
+                        if(!isset($_GET['act'])) {
+                            $_GET['act'] = 'index';
+                        }
+                        if(!isset($_GET['op'])) {
+                            $_GET['op'] = 'index';
+                        }
+                        if(!isset($_POST['act'])) {
+                            $_POST['act'] = 'index';
+                        }
+                        if(!isset($_POST['op'])) {
+                            $_POST['op'] = 'index';
+                        }
+
+                        //部分控制器不需要使用session.
+                        $act = $_GET['act'];
+                        if($act != 'refill') {
+                            session::instance()->start();
+                            Log::record("member_id=" . session_helper::memberid(),Log::DEBUG);
+                        }
+
+                        Base::mobile_control();
+                    }
+                }
+                else
+                {
+                    fcgi_header("Content-Type: text/html; charset=UTF-8");
+                    echo "no such file.";
+                }
+            }
+            catch (UnloginException $ex) {
+                mobileControl::outerr(errcode::ErrUnLogin,errcode::msg(errcode::ErrUnLogin),'','android');
+            }
+            catch (Exception $ex) {
+                mobileControl::outerr($ex->getCode(),$ex->getMessage(),'','android');
+                Log::record("run_looper exception catch code={$ex->getCode()} msg={$ex->getMessage()} trace={$ex->getTraceAsString()}",Log::ERR);
+            }
+            session::instance()->end();
+            fcgi_headers_sent();
+            $contents = ob_get_clean();
+            fcgi_echo($contents);
+            Log::end_sql_log();
+//            Log::record("content={$contents}",Log::DEBUG);
+
+            //fcgi_finish();//单线程的情况下不需要调用
+            $msg = sprintf("request time=%.6f\r\n\r\n",microtime(true) - $start);
+            Log::record($msg ,Log::DEBUG);
+        }
+
+        fcgi_fini();
+        Log::record('Waiting quit......',Log::DEBUG);
+    }
+}

+ 1 - 1
helper/mtopcard/mtopcard.php

@@ -125,7 +125,7 @@ function card_type($cardno)
         {
             if (empty($phone)) return false;  //手机号不能为空
             $url = "https://tcc.taobao.com/cc/json/mobile_tel_segment.htm?tel={$phone}";
-            $resp = file_get_contents($url);  //获取API返回 的数据
+            $resp = http_request($url);  //获取API返回 的数据
             $resp = mb_convert_encoding($resp, 'UTF-8', 'UTF-8,GBK,GB2312,BIG5'); //解决中文乱码
 
             $datas = explode('=', $resp);

+ 3 - 0
helper/refill/RefillFactory.php

@@ -6,6 +6,9 @@ namespace refill;
 
 require_once(BASE_HELPER_PATH . '/refill/RefillBase.php');
 
+require_once(BASE_HELPER_PATH . '/refill/afandeng/RefillPhone.php');
+require_once(BASE_HELPER_PATH . '/refill/afandeng/RefillCallBack.php');
+
 use Log;
 use StatesHelper;
 

+ 55 - 0
helper/refill/afandeng/RefillCallBack.php

@@ -0,0 +1,55 @@
+<?php
+
+
+namespace refill\afandeng;
+
+require_once(BASE_HELPER_PATH . '/refill/afandeng/config.php');
+
+
+use refill;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['signstr'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $content = $params['code'] . $params['tradeNoThird'] .$params['msg'] . $params['tradeNo'] . config::KEY;
+        if(empty($params['tradeNo'])) {
+            $content = $params['code'] . $params['tradeNoThird'] .$params['msg'] . config::KEY;
+        }
+        return md5($content);
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['code']);
+        $order_sn = $params['tradeNoThird'];
+        $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'];
+        
+        $data['official_sn'] = strtolower($params['tradeNo']) == 'null' ? '' : $params['tradeNo'];
+
+        if ($status === 200) {
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 300) {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 83 - 0
helper/refill/afandeng/RefillPhone.php

@@ -0,0 +1,83 @@
+<?php
+
+namespace refill\afandeng;
+
+require_once(BASE_HELPER_PATH . '/refill/afandeng/config.php');
+
+use refill;
+use Log;
+use mtopcard;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $amount, string $order_sn)
+    {
+        $params['merchantId'] = config::MCHID;
+        $params['orderType'] = 1;
+        $params['mobile'] = $phone;
+        $params['tradeNoThird'] = $order_sn;
+        $params['amount'] = sprintf("%.2f" , $amount);
+        $params['notifyUrl'] = config::NOTIFY_URL;
+
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params)
+    {
+        $params = $this->req_params($card_no, $amount, $params['order_sn']);
+        $sign = $this->sign($params);
+        $params['signstr'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params , 'POST' , false , config::ExtHeaders);
+        if ($resp === false) {
+            return [false, '系统错误'];
+        } else {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if ($resp['code'] == 200) {
+                return [true, $resp['body']['tradeNoSelf']];
+            } else {
+                return [false, $resp['msg']];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['merchantId'] = config::MCHID;
+        $params['tradeNoThird'] = $refill_info['order_sn'];
+        $content = $params['merchantId'] . $params['tradeNoThird'] . config::KEY;
+        $params['signstr'] = md5($content);
+        $resp = http_request(config::QUERY_URL, $params , 'GET' , false);
+        if ($resp === false) {
+            return [false, '系统错误'];
+        } else {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            $order_state = '';
+            if ($resp['code'] == 200) {
+                $order_state = ORDER_STATE_SUCCESS;
+            } elseif ($resp['code'] == 604) {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif ($resp['code'] == 603){
+                $order_state = ORDER_STATE_SEND;
+            }
+            if (empty($order_state)) {
+                return [false, $resp['msg']];
+            }
+            return [true, $order_state];
+        }
+    }
+
+    private function sign($params)
+    {
+        $key = config::KEY;
+        $content = $params['merchantId'] . $params['orderType'] . $params['mobile'] . $params['tradeNoThird'] . $params['amount'] . $params['notifyUrl'] . $key;
+        return md5($content);
+    }
+}

+ 16 - 0
helper/refill/afandeng/config.php

@@ -0,0 +1,16 @@
+<?php
+
+
+namespace refill\afandeng;
+
+
+class config
+{
+    const ORDER_URL = 'http://8.135.117.151:8124/supply/order/orderCheck';
+    const QUERY_URL = 'http://8.135.117.151:8124/supply/order/getSupplyOrderStatus';
+
+    const MCHID = 131;
+    const KEY = '4356f096d6ff947da4918e40bedc444e';
+    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/refill_afandeng.php";
+    const ExtHeaders = ['ContentType: application/x-www-form-urlencoded;charset=utf-8'];
+}

+ 3 - 3
helper/refill/api/xyz/bjb/RefillPhone.php

@@ -66,10 +66,10 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp,Log::DEBUG);
             $resp = ltrim($resp , '|');
-            if(!preg_match( '/^[0-3]\|[0-9]+-*[\x{4e00}-\x{9fa5}]+\|[0-9]*$/u',$resp,$matches)) {
-                return [false,'matching error'];
-            }
             $resp = explode('|' , $resp);
+            if(count($resp) != 3) {
+                return [false,'返回值错误'];
+            }
             $order_state = '';
             if ($resp[0] == 1) {
                 $order_state = ORDER_STATE_SUCCESS;

+ 3 - 3
helper/refill/api/xyz/bjbyd/RefillPhone.php

@@ -65,10 +65,10 @@ class RefillPhone extends refill\IRefillPhone
         {
             Log::record($resp,Log::DEBUG);
             $resp = ltrim($resp , '|');
-            if(!preg_match( '/^[0-3]\|[0-9]+-*[\x{4e00}-\x{9fa5}]+\|[0-9]+$/u',$resp,$matches)) {
-                return [false,'matching error'];
-            }
             $resp = explode('|' , $resp);
+            if(count($resp) != 3) {
+                return [false,'返回值错误'];
+            }
             $order_state = '';
             if ($resp[0] == 1) {
                 $order_state = ORDER_STATE_SUCCESS;

+ 40 - 0
mobile/control/merchant_order.php

@@ -54,6 +54,46 @@ class merchant_orderControl extends mbMerchantControl
         return self::outsuccess($result);
     }
 
+    public function OrderStatsOp()
+    {
+        if(empty($_GET['time_type']) || empty($_GET['start_time']) || empty($_GET['end_time'])) {
+            return self::outerr(errcode::ErrInputParam, "参数错误.");
+        }
+
+        $time_type = $_GET['time_type'];
+        if ($time_type == 'order_time') {
+            $cond['order_time'] = ['time', [$_GET['start_time'], $_GET['end_time']]];
+        }
+        if ($time_type == 'notify_time') {
+            $cond['notify_time'] = ['time', [$_GET['start_time'], $_GET['end_time']]];
+        }
+        if(empty($cond)) {
+            return self::outerr(errcode::ErrInputParam, "筛选日期类型错误.");
+        }
+        $cond['mchid'] = $this->mchid();
+        $stats = Model('')->table('refill_order,vr_order')->join('inner')
+            ->on('refill_order.order_id=vr_order.order_id')
+            ->field('count(*) as order_count ,sum(refill_amount) as refill_amounts, sum(mch_amount) as mch_amounts, order_state')
+            ->where($cond)->group('order_state')->select();
+
+        $result['count'] = $result['sendCount'] = $result['errorCount'] = $result['successCount'] = $result['refill_amounts'] = $result['mch_amounts'] = 0;
+        foreach ($stats as $stat) {
+            $result['count'] += $stat['order_count'];
+            if($stat['order_state'] == ORDER_STATE_SEND) {
+                $result['sendCount'] = $stat['order_count'];
+            }
+            if($stat['order_state'] == ORDER_STATE_CANCEL) {
+                $result['errorCount'] = $stat['order_count'];
+            }
+            if($stat['order_state'] == ORDER_STATE_SUCCESS) {
+                $result['successCount'] = $stat['order_count'];
+                $result['mch_amounts'] = $stat['mch_amounts'];
+                $result['refill_amounts'] = $stat['refill_amounts'];
+            }
+        }
+        return self::outsuccess($result);
+    }
+
     private function merchant_order_format($orders)
     {
         $data = [];

+ 9 - 0
mobile/refill_afandeng.php

@@ -0,0 +1,9 @@
+<?php
+
+//捷充的回调接口
+require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
+
+refill\RefillFactory::instance()->notify('afandeng',$_POST);
+
+echo ('success');
+

+ 16 - 5
test/TestRefill.php

@@ -114,6 +114,12 @@ class TestRefill extends TestCase
         }
     }
 
+    public function testAfandengPhone()
+    {
+        $providers = new refill\afandeng\RefillPhone([]);
+        $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
+    }
+
     public function testYifaPhone()
     {
         $providers = new refill\yifa\RefillPhone([]);
@@ -906,15 +912,20 @@ class TestRefill extends TestCase
     }
 
     public function testCheckData(){
-        $str = '2|110667993758599771-充值失败|';
-        $str = '0|提交成功|-36557.7400';
+        $str = '|2|110667993758599771-充值失败|';
+//        $str = '0|提交成功|-36557.7400';
 //        if(preg_match( '/^-*[0-9]{1,3}\|[\x{4e00}-\x{9fa5}]+\|-*[0-9]+\.*[0-9]+$/u',$str,$matches)) {
 //            return true;
 //        }
-        if(preg_match('/^[0-3]\|[0-9]+-*[\x{4e00}-\x{9fa5}]+\|[0-9]*$/u',$str,$matches)){
-            return true;
+//        if(preg_match('/^[0-3]\|[0-9]+-*[\x{4e00}-\x{9fa5}]+\|[0-9]*$/u',$str,$matches)){
+//            return true;
+//        }
+//        return false;
+        $resp = ltrim($str , '|');
+        $resp = explode('|' , $resp);
+        if(count($resp) != 3) {
+            return [false,'返回值错误'];
         }
-        return false;
     }
 
     public function testErrre()