소스 검색

配置代理

陈德本 5 년 전
부모
커밋
1459ac4e8f
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      App/Api/Controller/ReceivedSms.php

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

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