gdService = new GongdengOrderService(); $this->rechargeService = new RechargeService(); $this->cityService = new CityService(); $this->adServices = new AdService(); } /** * 获取首页广告轮播数据 * @return array */ public function banners(){ $banners = $this->adServices->geListBySort(1); $advert1 = $this->adServices->geDataBySort(2); $advert2 = $this->adServices->geListBySort(3); $data = [ 'banners'=> $banners? $banners : [], 'advert1'=> $advert1? $advert1 : [], 'advert2'=> $advert2? $advert2 : [], ]; return message(1005, true, $data); } /** * 获取jssdk参数 * @return array */ public function jssdk(){ $url = request()->get('url', ''); $jssdkParams = WechatService::getJssdkParams($url); RedisService::set('caches:shares:'.date('YmdHis'), ['url'=> $url,'params'=> $jssdkParams], 600); return message(1005,true, $jssdkParams); } /** * 城市列表 * @return array */ public function city(){ return $this->cityService->getPickerList(); } /** * 邀请奖励参数 * @return array */ public function inviteParams(){ $config = ConfigService::make()->getConfigByGroup(14); return message(1005,true, $config); } /** * 邀请奖励参数 * @return array */ public function vipParams(){ $config = ConfigService::make()->getConfigByGroup(15); return message(1005,true, $config); } /** * 平台参数 * @return array */ public function params(){ $config = ConfigService::make()->getConfigByGroup(16); return message(1005,true, $config); } /** * 获取验证订单信息 * @return array */ public function orderInfo(){ $orderSn = request()->get('order_sn'); if(empty($orderSn)){ return message('订单号参数错误', false); } $info = []; $prefix = substr($orderSn, 0,1); switch ($prefix){ case 'G': // 供灯 $info = $this->gdService->orderInfo($orderSn); break; case 'R': // 充值 $info = $this->rechargeService->orderInfo($orderSn); break; } if($info){ return message('获取订单信息', true, $info); }else{ return message('获取订单信息失败', false); } } public function banner(){ } }