$request['share_uid']]); } // $this->middleware('auth'); //检查是否有礼品 self::checkGift(); } //获取当前定位数组 public function getDefaultLocation() { $lat = session('lat', '45.76021'); $lng = session('lng', '126.66835'); $city = session('city', ''); $area = session('area', ''); $real_area = session('real_area', ''); $history_area = session('history_area', ''); if (!$area) { $area = Area::where('sn', '230100')->first(); } if (!$real_area) { session::put('real_area', $area); $real_area = session('real_area', ''); } $location = [ 'lat' => $lat, 'lng' => $lng, 'city' => $city, 'area' => $area, 'real_area' => $real_area, 'history_area' => $history_area, ]; return $location; } public function checkGift() { if (Auth::user()) { $gift = Order::where('user_id', Auth::id())->where('item_type', 'GIFT')->where('state', 'UNADDRESS')->first(); if ($gift) { $url = ($gift->type == 'lesson') ? route('gifts.unpay') : route('lottery.logs', ['type' => 'goods']); View::share('show_gift_url', $url); } } } }