12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace App\Http\Utils\DianYing;
- use App\Exceptions\CommonException;
- use App\Http\Bean\Util\KenDeJi\GetKfcOrdersParamBean;
- use App\Http\Enum\ErrorEnum;
- use App\Http\Utils\BaseUtil;
- use Tool\ShanTaoTool\HttpCurl;
- class DianYingUtil extends BaseUtil
- {
- /**
- * 获取肯德基活动转链
- * @param $sid string 推广位ID
- * @param string $phone 手机号码
- */
- public static function getDianYingActUrl($sid, $phone = "")
- {
- $url = "http://api.jutuike.com/Cinema/act";
- $params = [
- "apikey"=>env("JU_TUI_KE_API_KEY"),
- "sid"=>$sid
- ];
- if($phone){
- $params["mobile"] = $phone;
- }
- $res = HttpCurl::getCurl($url,$params);
- if($res["code"]!= 1){
- throw new CommonException(ErrorEnum::ERROR_KFC_URL);
- }
- return $res["data"];
- }
- /**
- * 获取kfc订单
- * @param GetKfcOrdersParamBean $getKfcOrdersParamBean
- */
- public static function getDianYingOrders(GetKfcOrdersParamBean $getKfcOrdersParamBean)
- {
- $url = "http://api.jutuike.com/Cinema/orders";
- $params = [
- "apikey"=>env("JU_TUI_KE_API_KEY"),
- "start_time"=>$getKfcOrdersParamBean->getStartTime(),
- "end_time"=>$getKfcOrdersParamBean->getEndTime(),
- "query_type"=>$getKfcOrdersParamBean->getQueryType(),
- "status"=>$getKfcOrdersParamBean->getStatus(),
- "page"=>$getKfcOrdersParamBean->getPage(),
- "pageSize"=>$getKfcOrdersParamBean->getPageSize()
- ];
- $res = HttpCurl::getCurl($url,$params);
- if($res["code"]==1){
- return $res["data"];
- }
- if($res["msg"]=="【对应条件内无数据】"){
- return [];
- }
- }
- }
|