Package Data | |
---|---|
Maintainer Username: | orzcc |
Maintainer Contact: | orzcczh@gmail.com (orzcc) |
Package Create Date: | 2015-07-03 |
Package Last Update: | 2024-07-30 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-11 15:22:32 |
Package Statistics | |
---|---|
Total Downloads: | 24,650 |
Monthly Downloads: | 196 |
Daily Downloads: | 15 |
Total Stars: | 107 |
Total Watchers: | 6 |
Total Forks: | 50 |
Total Open Issues: | 1 |
当前淘宝客 API 升级为2.0,原「淘宝客初级包」合并到了「淘宝客基础API」。
composer require orzcc/taobao-top-client
Orzcc\TopClient\TopClientServiceProvider::class,
'TopClient' => Orzcc\TopClient\Facades\TopClient::class,
php artisan vendor:publish --provider="Orzcc\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 orzcc/taobao-top-client
if (!class_exists('TopClient')) {
class_alias('Orzcc\TopClient\Facades\TopClient', 'TopClient');
}
$app->register(Orzcc\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);