|
14 | 14 | use App\Models\Cron;
|
15 | 15 | use App\Models\CronTask;
|
16 | 16 | use Carbon\Carbon;
|
| 17 | +use Curl\Http; |
17 | 18 | use Illuminate\Support\Facades\Cache;
|
18 | 19 | use Illuminate\Support\Facades\Cookie;
|
19 | 20 | use Illuminate\Support\Facades\Log;
|
@@ -271,6 +272,33 @@ public function getLine($path, $get)
|
271 | 272 | return ['to' => $to, 'line' => $arrayData];
|
272 | 273 | }
|
273 | 274 |
|
| 275 | + public function getLineData2($path, $get) |
| 276 | + { |
| 277 | + if (empty($path) || empty($get['cid']) || empty($get['LineGuid']) || empty($get['LineInfo'])) |
| 278 | + return false; |
| 279 | + |
| 280 | + $url = 'http://www.szjt.gov.cn/BusQu/APTSLine.aspx/GetData2'; |
| 281 | + $param = '{"guid":"'. $get['LineGuid']. '"}'; |
| 282 | + $header = [ |
| 283 | + 'content-type: Application/json', |
| 284 | + 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36', |
| 285 | + 'Accept: application/json', |
| 286 | + 'Host: www.szjt.gov.cn', |
| 287 | + 'Origin: http://www.szjt.gov.cn', |
| 288 | + ]; |
| 289 | + $data = Http::getInstent()->post($url, $param, 4, $header); |
| 290 | + |
| 291 | + if ($data['content']) { |
| 292 | + $res = json_decode($data['content'], true); |
| 293 | + if (isset($res['d'])) { |
| 294 | + $arr = json_decode($res['d'], true); |
| 295 | + return $arr['Document'] ?? []; |
| 296 | + } |
| 297 | + } |
| 298 | + return []; |
| 299 | + |
| 300 | + } |
| 301 | + |
274 | 302 | /**
|
275 | 303 | * 定时任务:artisan 执行入库操作
|
276 | 304 | */
|
|
0 commit comments