Download the PHP package cqgg/package_track without Composer
On this page you can find all versions of the php package cqgg/package_track. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package package_track
package_track
About
Package tracking data.
Demand
PHP: >=7.0
Install
composer require cqgg/package_track
version: 1.0.0
## Http website clone
https://github.com/CQGG/package_track.git
eg.
/**
* [packgeTrackSpider 根据数据库数据抓取]
* @return [type] [description]
*/
function packgeTrackSpider()
{
$map = []; //['carrier_code'=>'FEDEX'];
$package_data = db('order_package')->where($map)->field(true)->select();
$package_data_chunk = array_chunk($package_data, 500);
$spider_service = new \track\PackageTrack;
foreach ($package_data_chunk as $package_data) {
$track_data = [];
$spider_service->execute($package_data, function ($results) use (&$track_data) {
$data = [];
$now = date('Y-m-d H:i:s');
foreach ($results as $result) {
$data[] = [
'track_code' => $result['track_code'],
'carrier_code' => $result['carrier_code'],
'current_event' => $result['current_info'],
'track_events' => json_encode($result['track_log'], JSON_UNESCAPED_UNICODE),
'status' => $result['is_valid'] ? $result['is_over'] ? 2 : 1 : 0,
'create_time' => $now,
];
}
$track_data = array_merge($track_data, $data);
if (count($track_data) >= 50) {
db('package_tracking')->insertAll($track_data);
$track_data = [];
}
});
!empty($track_data) ? db('package_tracking')->insertAll($track_data) : true;
usleep(1000 * 30);
}
}
All versions of package_track with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.0.0
jaeger/querylist Version ^4.0
ares333/php-curl Version ^4.2
doctrine/cache Version 1.6.2
jaeger/querylist Version ^4.0
ares333/php-curl Version ^4.2
doctrine/cache Version 1.6.2
The package cqgg/package_track contains the following files
Loading the files please wait ....