stanley-king %!s(int64=4) %!d(string=hai) anos
pai
achega
0d986a5a66
Modificáronse 2 ficheiros con 20 adicións e 3 borrados
  1. 10 1
      helper/refill/api/xyz/yunling/RefillCallBack.php
  2. 10 2
      test/TestRedis.php

+ 10 - 1
helper/refill/api/xyz/yunling/RefillCallBack.php

@@ -7,6 +7,7 @@ require_once(BASE_HELPER_RAPI_PATH . '/yunling/config.php');
 
 
 use refill;
+use Log;
 
 class RefillCallBack implements refill\IRefillCallBack
 {
@@ -31,6 +32,8 @@ class RefillCallBack implements refill\IRefillCallBack
 
     public function notify($params)
     {
+        Log::record("notify params:" . json_encode($params),Log::DEBUG);
+
         $status = intval($params['resultno']);
         $order_sn = $params['sporderid'];
         $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
@@ -38,7 +41,13 @@ class RefillCallBack implements refill\IRefillCallBack
             return [false, false, false,false];
         }
         $order_id = $order_info['order_id'];
-        $data['official_sn'] = strtolower($params['supnumber']) == 'null' ? '' : $params['supnumber'];
+
+        if(empty($params['supnumber'])) {
+            $data['official_sn'] = '';
+        }
+        else {
+            $data['official_sn'] = strtolower($params['supnumber']) == 'null' ? '' : $params['supnumber'];
+        }
 
         if ($status === 1) {
             Model('refill_order')->edit($order_id, $data);

+ 10 - 2
test/TestRedis.php

@@ -1,4 +1,4 @@
-<?php declare(strict_types=1);
+<?php declare(strict_types=0);
 
 use PHPUnit\Framework\TestCase;
 define('APP_ID', 'test');
@@ -176,11 +176,19 @@ class TestRedis extends TestCase
 
     public function testSHA1()
     {
-        $x = sha1('xxxxxxxx',true);
+        $params['supnumber'] = 'null';
+        $y = strtolower($params['supnumber']) == 'null' ? '' : $params['supnumber'];
+        $z = strtolower($params['supnumber']) ?? '';
+
+
+        $params = [];
+        $y = strtolower($params['supnumber']) == 'null' ? '' : $params['supnumber'];
+        $z = strtolower($params['supnumber']) ?? '';
     }
 
     public static function tearDownAfterClass() : void
     {
 
+
     }
 }