mengsen / taobao
淘宝客、淘宝联盟、淘宝API
dev-master
2019-12-09 09:53 UTC
Requires
- php: >=5.6
This package is auto-updated.
Last update: 2025-04-09 22:11:18 UTC
README
淘宝客
工厂类
namespace app\common\factory;
use mengsen\taobao\TopClient;
class Taobao
{
private static $obj = null;
public static function getInstance()
{
if (self::$obj == null) {
$conf = config('taobao.union');
$app = new TopClient($conf['appkey'], $conf['secretKey']);
self::$obj = $app;
}
return self::$obj;
}
}
DEMO
$app = Taobao::getInstance();
$res = $app->execute('taobao.union.open.promotion.common.get', [
'promotionCodeReq' => [
'siteId' => '1937243904',
'materialId' => $param['material_id'],
// 'ext1' => 'h5'
],
]);