本文整理汇总了PHP中app\Page::resort方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::resort方法的具体用法?PHP Page::resort怎么用?PHP Page::resort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Page
的用法示例。
在下文中一共展示了Page::resort方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: activityShow
public function activityShow()
{
$idPageActivities = 58;
$page = Page::resort($this->resortId)->active()->id($idPageActivities)->with(['contents' => function ($query) {
$query->where('lang_id', '=', $this->langId);
}])->first();
if ($page) {
$page = $page->contents->first();
$identifier = Page::find($idPageActivities);
//return dd($identifier->toArray());
return View('pages.activitySingle', compact('page', 'identifier'));
}
}
示例2: offers
public function offers()
{
$idHomeOffers = 8;
$page = Page::resort($this->resortId)->active()->id($idHomeOffers)->with(['contents' => function ($query) {
$query->where('lang_id', '=', $this->langId);
}])->first();
if ($page) {
$page = $page->contents->first();
if (Agent::isMobile()) {
$offers = Offer::active()->range()->whereHas('resorts', function ($q) {
$q->where('id', $this->resortId);
})->whereHas('websites', function ($q) {
$q->where('id', $this->website_id);
})->with(['contents' => function ($query) {
$query->where('lang_id', '=', $this->langId);
}])->orderBy('priority', 'desc')->get();
} else {
$offers = Offer::active()->range()->whereHas('websites', function ($q) {
$q->where('id', $this->website_id);
})->whereHas('resorts', function ($q) {
$q->where('id', $this->resortId);
})->with(['contents' => function ($query) {
$query->where('lang_id', '=', $this->langId);
}])->where('mobile_only', 0)->orderBy('priority', 'desc')->get();
}
$packages = Package::active()->with(['contents' => function ($query) {
$query->where('lang_id', '=', $this->langId);
}])->orderBy('priority', 'desc')->get();
//return dd($packages->toArray());
return View('pages.offers', compact('page', 'offers', 'packages'));
} else {
App::abort(404);
}
}
示例3: offers
public function offers()
{
$idHomeOffers = 41;
//este id es el id de la pagina en la base de datos en la tabla page con campo id
$page = Page::resort($this->resortId)->active()->id($idHomeOffers)->with(['contents' => function ($query) {
$query->where('lang_id', '=', $this->langId);
}])->first();
if ($page) {
$page = $page->contents->first();
if (Agent::isMobile()) {
$offers = Offer::active()->range()->whereHas('resorts', function ($q) {
$q->where('id', $this->resortId);
})->whereHas('contents', function ($q) {
$q->where('lang_id', $this->langId);
})->with(['contents' => function ($query) {
$query->where('lang_id', '=', $this->langId);
}])->orderBy('priority', 'desc')->get();
} else {
$offers = Offer::active()->range()->whereHas('resorts', function ($q) {
$q->where('id', $this->resortId);
})->whereHas('contents', function ($q) {
$q->where('lang_id', $this->langId);
})->with(['contents' => function ($query) {
$query->where('lang_id', '=', $this->langId);
}])->where('mobile_only', 0)->orderBy('priority', 'desc')->get();
}
//return dd($offers);
return View('pages.offers', compact('page', 'offers'));
} else {
App::abort(404);
}
}