Package Data | |
---|---|
Maintainer Username: | tenstone |
Maintainer Contact: | tenstone@foxmail.com (tenstone) |
Package Create Date: | 2016-09-30 |
Package Last Update: | 2016-09-30 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-14 15:08:30 |
Package Statistics | |
---|---|
Total Downloads: | 34 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 1 |
Total Open Issues: | 0 |
当前淘宝客 API 升级为2.0,原「淘宝客初级包」合并到了「淘宝客基础API」。
composer require tenstone/taobao-top-client
Tenstone\TopClient\TopClientServiceProvider::class,
'TopClient' => Tenstone\TopClient\Facades\TopClient::class,
php artisan vendor:publish --provider="Tenstone\TopClient\TopClientServiceProvider"
生成配置文件use TopClient;
use TopClient\request\TbkItemGetRequest;
$topclient = TopClient::connection();
$req = new TbkItemGetRequest;
$req->setFields("num_iid,title,pict_url,reserve_price,zk_final_price,user_type,provcity,item_url");
$req->setQ('手机');
$req->setSort("tk_total_sales");
$req->setPageNo('1'); // 实验后发现必需用字符串的数字才能正确分页
$req->setPageSize('40');
$resp = $topclient->execute($req);
dd($resp);
composer require tenstone/taobao-top-client
if (!class_exists('TopClient')) {
class_alias('Tenstone\TopClient\Facades\TopClient', 'TopClient');
}
$app->register(Tenstone\TopClient\TopClientServiceProvider::class);
use TopClient;
use TopClient\request\TbkItemGetRequest;
$topclient = TopClient::connection();
$req = new TbkItemGetRequest;
$req->setFields("num_iid,title,pict_url,reserve_price,zk_final_price,user_type,provcity,item_url");
$req->setQ('手机');
$req->setSort("tk_total_sales");
$req->setPageNo('1'); // 实验后发现必需用字符串的数字才能正确分页
$req->setPageSize('40');
$resp = $topclient->execute($req);
dd($resp);