1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace App\Http\Utils\McDonalds;
- use App\Exceptions\CommonException;
- use App\Http\Bean\Util\KenDeJi\GetKfcOrdersParamBean;
- use App\Http\Bean\Util\McDonalds\GetMdlOrdersParamsBean;
- use App\Http\Enum\AccountTypeEnum;
- use App\Http\Enum\ErrorEnum;
- use App\Http\Utils\BaseUtil;
- use App\Models\UserSpreadModel;
- use Tool\ShanTaoTool\HttpCurl;
- class McDonaldsUtil extends BaseUtil
- {
- /**
- * 获取活动转链
- * @param $sid string 推广位ID
- * @param string $phone 手机号码
- */
- public static function getMdlActUrl($sid, $phone = "")
- {
- $url = "http://api.jutuike.com/mcdonald/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"];
- }
- /**
- * 获取mdl订单
- * @param GetKfcOrdersParamBean $getKfcOrdersParamBean
- */
- public static function getMdlOrders(GetMdlOrdersParamsBean $getKfcOrdersParamBean)
- {
- $url = "http://api.jutuike.com/mcdonald/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);
- return $res["data"];
- }
- }
|