本文整理汇总了PHP中Page::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::where方法的具体用法?PHP Page::where怎么用?PHP Page::where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Page
的用法示例。
在下文中一共展示了Page::where方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
parent::show();
$menus = Page::where("slug", "!=", "")->orderBy("menu_sort_order")->get();
$banner = $this->banner;
return $this->respond($menus, 'menus.index', compact('menus', 'banner'));
}
示例2: tim_viec_danh_muc
public function tim_viec_danh_muc($id, $phanloai, $title)
{
$data['post'] = Page::where('loai', $id)->where('phanloai', $phanloai)->orderBy('id', 'desc')->paginate(11);
$data['loai'] = $id;
$data['phan_loai'] = '.phan-loai-' . $phanloai;
if ($id == 1) {
$data['title'] = 'Việc làm Gia Sư Đà Nẵng - Tìm việc Gia Sư dành cho sinh viên';
} elseif ($id == 2) {
$data['title'] = 'Việc làm nhân viên bán hàng - Tuyển dụng nhân viên bán hàng';
} elseif ($id == 3) {
$data['title'] = 'Tuyển dụng, tìm việc làm giữ xe, phát tờ rơi, nhân viên bảo vệ';
} elseif ($id == 4) {
$data['title'] = 'Việc Làm Nhân Viên Phục Vụ - Tìm việc làm phục vụ cafe ĐN';
} elseif ($id == 5) {
$data['title'] = 'Việc làm PG, Tiếp Thị | Tìm việc làm Tiếp Thị, PG tại Đà Nẵng';
} elseif ($id == 6) {
$data['title'] = 'Việc Làm Tạp Vụ, Giúp Việc - Tìm việc làm tạp vụ, giúp việc ĐN';
} elseif ($id == 7) {
$data['title'] = 'Việc Làm Thực Tập - Tìm việc làm thực tập sinh viên Đà Nẵng';
} elseif ($id == 8) {
$data['title'] = 'Việc Làm Cộng Tác Viên - Tuyển cộng tác viên - Tìm việc CTV';
} elseif ($id == 9) {
$data['title'] = 'Việc Làm Freelancer Đà Nẵng- Tìm việc freelancer - Freelancer ';
} else {
$data['title'] = 'Việc làm đa cấp | Website viec lam sinh vien so 1 tai Da Nang';
}
return View::make('template.content', $data);
}
示例3: getUnUsedLanguageList
/**
* Gets a list of languages that the page has not been translated to or originates from
*
* @param integer $pageId
* @param array $languages
* @return array
*/
public function getUnUsedLanguageList($pageId, $languages)
{
$existingLangages = $this->Page->where(function ($query) use($pageId) {
$query->where('id', $pageId)->orWhere('translated_from_page_id', $pageId);
})->lists('title', 'language_id');
return array_diff_key($languages, $existingLangages->toArray());
}
示例4: totalPages
/**
* Get total page count.
*
* @param bool $all
*
* @return mixed
*/
protected function totalPages($all = false)
{
if (!$all) {
return $this->page->where('is_published', 1)->where('lang', $this->getLang())->count();
}
return $this->page->where('lang', $this->getLang())->count();
}
示例5: compress
/**
* Creates a compressed cache file for the chapter
*
* @author Woxxy
* @return url to compressed file
*/
function compress($comic, $language = 'en', $volume = null, $chapter = null, $subchapter = 0)
{
require_once FCPATH . 'assets/pclzip/pclzip.lib.php';
$files = array();
if (get_setting('fs_dl_volume_enabled') && $volume !== null && $chapter === null) {
if ($volume == 0) {
show_404();
}
$chapters = new Chapter();
$chapters->where('comic_id', $comic->id)->where('volume', $volume)->order_by('volume', 'asc')->order_by('chapter', 'asc')->order_by('subchapter', 'asc')->get();
if ($chapters->result_count() == 0) {
show_404();
}
$volume_id = $volume;
$chapter_id = $chapters->id;
$filepath = $comic->directory();
$filename = $this->filename_chapters_compressed($chapters);
foreach ($chapters as $chaptere) {
$pages = new Page();
$pages->where('chapter_id', $chaptere->id)->get();
foreach ($pages as $page) {
$files[] = array(PCLZIP_ATT_FILE_NAME => 'content/comics/' . $comic->directory() . '/' . $chaptere->directory() . '/' . $page->filename, PCLZIP_ATT_FILE_NEW_FULL_NAME => $this->filename_chapter_compressed($chaptere) . '/' . $page->filename);
}
}
} else {
$chaptere = new Chapter();
$chaptere->where('comic_id', $comic->id)->where('language', $language)->where('volume', $volume)->where('chapter', $chapter)->where('subchapter', $subchapter);
$chaptere->get();
if ($chaptere->result_count() == 0) {
show_404();
}
$volume_id = 0;
$chapter_id = $chaptere->id;
$filepath = $comic->directory() . '/' . $chaptere->directory();
$filename = $this->filename_chapter_compressed($chaptere);
$pages = new Page();
$pages->where('chapter_id', $chaptere->id)->get();
foreach ($pages as $page) {
$files[] = 'content/comics/' . $comic->directory() . '/' . $chaptere->directory() . '/' . $page->filename;
}
}
$this->where('comic_id', $comic->id)->where('volume_id', $volume_id)->where('chapter_id', $chapter_id)->get();
if ($this->result_count() == 0 || !file_exists('content/comics/' . $filepath . '/' . $this->filename)) {
$this->remove_old();
$archive = new PclZip('content/comics/' . $filepath . '/' . $filename . '.zip');
$archive->create($files, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_NO_COMPRESSION);
$this->comic_id = $comic->id;
$this->volume_id = $volume_id;
$this->chapter_id = $chapter_id;
$this->filename = $filename . '.zip';
$this->size = filesize('content/comics/' . $filepath . '/' . $filename . '.zip');
$this->lastdownload = date('Y-m-d H:i:s', time());
$this->save();
} else {
$this->lastdownload = date('Y-m-d H:i:s', time());
$this->save();
}
return array("url" => site_url() . 'content/comics/' . $filepath . '/' . urlencode($this->filename), "server_path" => FCPATH . 'content/comics/' . $filepath . '/' . $this->filename);
}
示例6: getMappedPage
public function getMappedPage()
{
$page = Page::where('uri', $this->uri)->first();
if (!$page) {
return false;
}
return $page;
}
示例7: view
/**
* Setup the layout used by the controller.
*
* @return void
*/
public function view($slug)
{
if ($page = Page::where('slug', $slug)->first()) {
return View::make('pages.index')->with('page', $page)->with('custom', '0');
} else {
App::abort('404');
}
}
示例8: boot
public static function boot()
{
parent::boot();
//删除时先删除相关文档、单页
self::deleting(function (User $user) {
Article::where('uid', '=', $user->id)->delete();
Page::where('uid', '=', $user->id)->delete();
});
}
示例9: index
function index()
{
$pages = new Page();
if (@$_GET['search']) {
$pages->where("title like '%" . $_GET['search'] . "%'");
}
$data['pages'] = $pages->order_by('id', 'desc')->get_page();
$this->template->build('admin/page_index', $data);
}
示例10: show
/**
* Display the specified resource.
*
* @param string $slug
* @return Response
*/
public function show($slug)
{
// Check if the page exists
if (is_null($page = Page::where('slug', $slug)->first())) {
// Put a 404 in ur face, yo !
return App::abort(404);
}
return View::make('modules.page.show')->with('page', Page::where('slug', $slug)->first());
}
示例11: show
/**
* Display customer profile
*
* @param $profile
* @return Response
*/
public function show($profile)
{
$p = User::where('profile_url', '=', $profile)->where('approved', '=', '0')->first();
$page = Page::where('title', '=', 'faq-customer')->first();
$follow = Follow::where('user', $p->id)->where('hub', '=', 0)->get();
$follow_hub = Follow::where('user', $p->id)->where('artist', '=', 0)->get();
$wall = new \Illuminate\Database\Eloquent\Collection();
$events = new \Illuminate\Database\Eloquent\Collection();
$comments = Comment::where('user', '=', $p->id)->orderBy('created_at', 'desc')->get();
$hidden = unserialize(Cookie::get('hide'));
//dd( Cookie::get('hide') );
if (count($follow) > 0) {
foreach ($follow as $f) {
$s = Song::where('artist', '=', $f->artist)->where('completed', '=', '1')->get();
$e = ArtistEvent::where('artist', '=', $f->artist)->where('date', '>', \Carbon\Carbon::now())->get();
$wall = $wall->merge($s);
$events = $events->merge($e);
}
}
if (count($follow_hub) > 0) {
foreach ($follow_hub as $h) {
$hub = Hub::where('id', '=', $h->hub)->first();
if (!is_null($hub)) {
$artists = User::where('type', '=', 'artist')->where('hub', '=', $hub->id)->get();
$artists_list = [];
$songs = [];
$events = [];
foreach ($artists as $a) {
$artists_list[] = $a->id;
}
if (count($artists_list) > 0) {
$songs = Song::where('completed', '=', '1')->whereIn('artist', $artists_list)->orderBy('created_at', 'desc')->get();
$events = ArtistEvent::whereIn('artist', $artists_list)->get();
}
$news = News::where('hub', '=', $hub->id)->take(3)->get();
$wall = $wall->merge($songs);
$events = $events->merge($events);
}
}
}
$purchased = Purchase::where('customer', '=', $p->id)->get();
foreach ($purchased as $pp) {
$song_purchased = Song::withTrashed()->where('id', '=', $pp->song)->get();
$download = Download::where('customer', '=', $p->id)->where('song', '=', $pp->song)->first();
$song_purchased[0]->purchased = true;
if (isset($download)) {
$song_purchased[0]->link = $download->url;
}
$wall = $wall->merge($song_purchased);
}
$wall->sortByDesc('created_at');
if (!isset($news)) {
$news = null;
}
return View::make('customer.profile-new', ['profile' => $p, 'wall' => $wall, 'page' => $page, 'events' => $events, 'comments' => $comments, 'hidden' => $hidden, 'news' => $news]);
}
示例12: it_returns_the_fresh_model_fetched_from_the_database
/** @test **/
public function it_returns_the_fresh_model_fetched_from_the_database()
{
$this->createComponent('pages');
$this->insertOn('pages', ['title' => 'Psych!', 'content' => 'GUUUS!!!']);
$page = Page::where('title', 'Psych!')->first();
$page->title = 'House';
$page = $page->fresh();
$this->assertEquals('Psych!', $page->title);
$this->assertEquals('GUUUS!!!', $page->content);
}
示例13: getPageid
public static function getPageid()
{
$route = AppHelper::curPageURL();
$pageId = Page::where('route', '=', $route)->get();
//return $user;
foreach ($pageId as $value) {
$id = $value['id'];
}
return $id;
}
示例14: getPage
public function getPage($slug)
{
$page = Page::where('slug', $slug)->first();
if (empty($page)) {
$page = new Page();
$page->slug = $slug;
$page->content = "Empty Page -> Please Edit in Admin Section";
$page->save();
}
return View::make('site.pages.index', compact('page'));
}
示例15: index
/**
* Display the specified post.
*
* @param int $id
* @return Response
*/
public function index($slug)
{
$page = Page::where('slug', '=', $slug)->first();
//Make sure page is active
if (!Auth::guest() && Auth::user()->role == 'admin' || $page->active) {
$author = User::find($page->user_id);
$data = array('page' => $page, 'author' => $author, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
return View::make('Theme::page', $data);
} else {
return Redirect::to('pages')->with(array('note' => 'Sorry, this page is no longer active.', 'note_type' => 'error'));
}
}