陈德本 hace 5 años
padre
commit
661b1f2874
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      App/Api/Controller/ReceivedSms.php

+ 3 - 3
App/Api/Controller/ReceivedSms.php

@@ -23,13 +23,13 @@ class ReceivedSms extends RestfulController
         foreach ($data as $datum) {
             $pat = "#\[(.*)\]-\[IP.*\[操作:(.*)\]#iUs";
             preg_match($pat, $datum, $arr);
-            if ($arr[1]) {
-                $temp = explode("$$$", $arr[1]);
+            if ($arr) {
+                $temp = explode("$$$", $arr[2]);
                 $result[] = [
                     'from' => $temp[1],
                     'to' => $temp[2],
                     'msg' => $temp[0],
-                    'time' => $arr[0]
+                    'time' => $arr[1]
                 ];
             }