Explorar o código

wesmiler 报恩寺项目提交

wesmiler %!s(int64=4) %!d(string=hai) anos
pai
achega
e92c73a70d
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      app/Http/Controllers/Api/v1/IndexController.php

+ 4 - 2
app/Http/Controllers/Api/v1/IndexController.php

@@ -181,10 +181,12 @@ class IndexController extends BaseController
         $content1 = file_get_contents($apiUrl.'/laohuangli/');
         $temp1 = substr($content1,strpos($content1, '<div class="goodcalendar4">'));
         $temp1 = substr($temp1,0, strpos($temp1, '</div>'));
-        preg_match("/<td>(.*)<\/td>/", $temp1, $yi);
+        preg_match("/<\/td><td>(.*)<\/td><td>/", $temp1, $yi);
+        $yi = isset($yi[1])? $yi[1] : '';
         preg_match("/<td colspan=\"3\">(.*)<\/td>/", $temp1, $ji);
+        $ji = isset($ji[1])? $ji[1] : '';
 
-        return message(MESSAGE_OK, true, ['content'=> $content, 'result'=> $temp,'yj'=> $temp1,'yi'=> $yi,'ji'=> $ji]);
+        return message(MESSAGE_OK, true, ['content'=> $content, 'result'=> $temp,'yj'=> $temp1,'yi'=> $yi,'ji'=> isset()]);
 
     }
 }