Browse Source

wesmiler 更新代码

wesmiler 1 year ago
parent
commit
e65f14dc34

+ 1 - 3
app/Console/Commands/Socket.php

@@ -60,9 +60,7 @@ class Socket extends Command
     {
         try {
             //创建websocket服务器对象,监听0.0.0.0:7104端口
-            $this->ws = new \swoole_websocket_server("0.0.0.0", env('SOCKET_PORT', '6520'));
-
-//        $this->ws->set();
+            $this->ws = new \Swoole\WebSocket\Server("0.0.0.0", env('SOCKET_PORT', '6520'));
 
             //监听WebSocket连接打开事件
             $this->ws->on('open', [$this, 'open']);

+ 4 - 4
app/Helpers/common.php

@@ -971,7 +971,7 @@ if (!function_exists('is_idcard')) {
                 $arr_ch = array('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2');
                 $sign = 0;
                 for ($i = 0; $i < 17; $i++) {
-                    $b = (int)$idno{$i};
+                    $b = (int)$idno[$i];
                     $w = $arr_int[$i];
                     $sign += $b * $w;
                 }
@@ -1424,11 +1424,11 @@ if (!function_exists('save_remote_image')) {
         if (!$content) {
             return false;
         }
-        if ($content{0} . $content{1} == "\xff\xd8") {
+        if ($content[0] . $content[1] == "\xff\xd8") {
             $image_ext = 'jpg';
-        } elseif ($content{0} . $content{1} . $content{2} == "\x47\x49\x46") {
+        } elseif ($content[0] . $content[1] . $content[2] == "\x47\x49\x46") {
             $image_ext = 'gif';
-        } elseif ($content{0} . $content{1} . $content{2} == "\x89\x50\x4e") {
+        } elseif ($content[0] . $content[1] . $content[2] == "\x89\x50\x4e") {
             $image_ext = 'png';
         } else {
             // 不是有效图片

+ 4 - 4
app/Lib/phpqrcode/QRcode.php

@@ -993,7 +993,7 @@ class QRimage
 {
 
     //----------------------------------------------------------------------
-    public static function png($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4, $saveandprint = FALSE, $back_color, $fore_color)
+    public static function png($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4, $saveandprint = FALSE, $back_color='', $fore_color='')
     {
         $image = self::image($frame, $pixelPerPoint, $outerFrame, $back_color, $fore_color);
 
@@ -3640,7 +3640,7 @@ class QRvect
     }
 
     //----------------------------------------------------------------------
-    public static function svg($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4, $saveandprint = FALSE, $back_color, $fore_color)
+    public static function svg($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4, $saveandprint = FALSE, $back_color='', $fore_color='')
     {
         $vect = self::vectSVG($frame, $pixelPerPoint, $outerFrame, $back_color, $fore_color);
 
@@ -3713,7 +3713,7 @@ class QRvect
         return $output;
     }
 }
-    
-    
+
+
 
 

File diff suppressed because it is too large
+ 1990 - 0
app/Services/UsdtWalletService1.php