1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace App\Http\Utils;
- use App\Exceptions\CommonException;
- use App\Http\Enum\ErrorEnum;
- use Tool\ShanTaoTool\HttpCurl;
- /**
- * 黑马淘客工具类
- * Class HeiMaUtil
- * @package App\Http\Utils
- */
- class HeiMaUtil extends BaseUtil
- {
- //基础链接
- static $baseUrl = "https://www.heimataoke.com/";
- /**
- * 根据商品ID获取商品的佣金信息
- * @param $goodsId
- */
- public static function gaoYongZhuanLian($goodsId)
- {
- $url = self::$baseUrl."api-zhuanlian";
- $params = [
- "appkey"=>"611653348",
- "appsecret"=>"4f660e85e93bc45012591d0a314997d6",
- "sid"=>"4463",
- "pid"=>"mm_101807570_250550471_102348550452",
- // "pid"=>"mm_34231311_452000065_108585250029",
- "num_iid"=>$goodsId,
- "signurl"=>1
- ];
- $res = HttpCurl::getCurl($url,$params);
- $url = $res["url"];
- $response = HttpCurl::getCurl($url);
- if(isset($response["tbk_privilege_get_response"])){
- return $response["tbk_privilege_get_response"]["result"]["data"];
- }
- $instance = new LoggerFactoryUtil(HeiMaUtil::class);
- $instance->info("上游返回信息:".json_encode($response));
- throw new CommonException(ErrorEnum::ERROR_SYSTEM);
- }
- /**
- * 获取订单列表
- */
- public static function getOrderList()
- {
- $url = self::$baseUrl."api-order";
- $params = [
- "appkey"=>"",
- "appsecret"=>"",
- "sid"=>"",
- "start_time"=>"mm_34231311_452000065_108585250029",
- "end_time"=>"",
- "page_no"=>1,
- "page_size"=>100,
- "signurl"=>1,
- "query_type"=>2
- ];
- }
- }
|