当前位置: 首页>>代码示例>>PHP>>正文


PHP Video::where方法代码示例

本文整理汇总了PHP中Video::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Video::where方法的具体用法?PHP Video::where怎么用?PHP Video::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Video的用法示例。


在下文中一共展示了Video::where方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     $param['videos'] = VideoModel::where('company_id', Session::get('company_id'))->paginate(10);
     $param['pageNo'] = 4;
     if ($alert = Session::get('alert')) {
         $param['alert'] = $alert;
     }
     return View::make('company.video.index')->with($param);
 }
开发者ID:victory21th,项目名称:QM-Laravel,代码行数:9,代码来源:VideoController.php

示例2: index

 public function index()
 {
     if (\Input::get('theme')) {
         \Cookie::queue('theme', \Input::get('theme'), 100);
         return Redirect::to('/')->withCookie(cookie('theme', \Input::get('theme'), 100));
     }
     $data = array('videos' => Video::where('active', '=', '1')->orderBy('created_at', 'DESC')->simplePaginate($this->videos_per_page), 'current_page' => 1, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/videos', 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
     //dd($data['videos']);
     return View::make('Theme::home', $data);
 }
开发者ID:rinodung,项目名称:hello-video-laravel,代码行数:10,代码来源:ThemeHomeController.php

示例3: index

 public function index()
 {
     $search_value = Input::get('value');
     if (empty($search_value)) {
         return Redirect::to('/');
     }
     $videos = Video::where('active', '=', 1)->where('title', 'LIKE', '%' . $search_value . '%')->orderBy('created_at', 'desc')->get();
     $posts = Post::where('active', '=', 1)->where('title', 'LIKE', '%' . $search_value . '%')->orderBy('created_at', 'desc')->get();
     $data = array('videos' => $videos, 'posts' => $posts, 'search_value' => $search_value, '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::search-list', $data);
 }
开发者ID:rinodung,项目名称:hello-video-laravel,代码行数:11,代码来源:ThemeSearchController.php

示例4: index

 /**
  * Setup the layout used by the controller.
  *
  * @return void
  */
 public function index()
 {
     $start = (new Carbon('now'))->hour(0)->minute(0)->second(0);
     $end = (new Carbon('now'))->hour(23)->minute(59)->second(59);
     $total_subscribers = count(User::where('active', '=', 1)->where('role', '=', 'subscriber')->where('stripe_active', '=', 1)->get());
     $new_subscribers = count(User::where('active', '=', 1)->where('role', '=', 'subscriber')->where('stripe_active', '=', 1)->whereBetween('created_at', [$start, $end])->get());
     $total_videos = count(Video::where('active', '=', 1)->get());
     $total_posts = count(Post::where('active', '=', 1)->get());
     $settings = Setting::first();
     $data = array('admin_user' => Auth::user(), 'total_subscribers' => $total_subscribers, 'new_subscribers' => $new_subscribers, 'total_videos' => $total_videos, 'total_posts' => $total_posts, 'settings' => $settings);
     return View::make('admin.index', $data);
 }
开发者ID:rinodung,项目名称:hello-video-laravel,代码行数:17,代码来源:AdminController.php

示例5: index

 /**
  * Display a listing of videos
  *
  * @return Response
  */
 public function index()
 {
     $search_value = Input::get('s');
     if (!empty($search_value)) {
         $videos = Video::where('title', 'LIKE', '%' . $search_value . '%')->orderBy('created_at', 'desc')->paginate(9);
     } else {
         $videos = Video::orderBy('created_at', 'DESC')->paginate(9);
     }
     $user = Auth::user();
     $data = array('videos' => $videos, 'user' => $user, 'admin_user' => Auth::user());
     return View::make('admin.videos.index', $data);
 }
开发者ID:rinodung,项目名称:hello-video-laravel,代码行数:17,代码来源:AdminVideosController.php

示例6: index

 public function index($username)
 {
     $user = User::where('username', '=', $username)->first();
     $favorites = Favorite::where('user_id', '=', $user->id)->orderBy('created_at', 'desc')->get();
     $favorite_array = array();
     foreach ($favorites as $key => $fave) {
         array_push($favorite_array, $fave->video_id);
     }
     $videos = Video::where('active', '=', '1')->whereIn('id', $favorite_array)->take(9)->get();
     $data = array('user' => $user, 'type' => 'profile', 'videos' => $videos, '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::user', $data);
 }
开发者ID:rinodung,项目名称:hello-video-laravel,代码行数:12,代码来源:ThemeUserController.php

示例7: show_favorites

 public function show_favorites()
 {
     if (!Auth::guest()) {
         $page = Input::get('page');
         if (empty($page)) {
             $page = 1;
         }
         $favorites = Favorite::where('user_id', '=', Auth::user()->id)->orderBy('created_at', 'desc')->get();
         $favorite_array = array();
         foreach ($favorites as $key => $fave) {
             array_push($favorite_array, $fave->video_id);
         }
         $videos = Video::where('active', '=', '1')->whereIn('id', $favorite_array)->paginate(12);
         $data = array('videos' => $videos, 'page_title' => ucfirst(Auth::user()->username) . '\'s Favorite Videos', 'current_page' => $page, 'page_description' => 'Page ' . $page, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/favorites', 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
         return View::make('Theme::video-list', $data);
     } else {
         return Redirect::to('videos');
     }
 }
开发者ID:rinodung,项目名称:hello-video-laravel,代码行数:19,代码来源:ThemeFavoriteController.php

示例8: category

 public function category($category)
 {
     $page = Input::get('page');
     if (!empty($page)) {
         $page = Input::get('page');
     } else {
         $page = 1;
     }
     $cat = VideoCategory::where('slug', '=', $category)->first();
     $parent_cat = VideoCategory::where('parent_id', '=', $cat->id)->first();
     if (!empty($parent_cat->id)) {
         $parent_cat2 = VideoCategory::where('parent_id', '=', $parent_cat->id)->first();
         if (!empty($parent_cat2->id)) {
             $videos = Video::where('active', '=', '1')->where('video_category_id', '=', $cat->id)->orWhere('video_category_id', '=', $parent_cat->id)->orWhere('video_category_id', '=', $parent_cat2->id)->orderBy('created_at', 'DESC')->simplePaginate(9);
         } else {
             $videos = Video::where('active', '=', '1')->where('video_category_id', '=', $cat->id)->orWhere('video_category_id', '=', $parent_cat->id)->orderBy('created_at', 'DESC')->simplePaginate(9);
         }
     } else {
         $videos = Video::where('active', '=', '1')->where('video_category_id', '=', $cat->id)->orderBy('created_at', 'DESC')->simplePaginate(9);
     }
     $data = array('videos' => $videos, 'current_page' => $page, 'category' => $cat, 'page_title' => 'Videos - ' . $cat->name, 'page_description' => 'Page ' . $page, 'pagination_url' => '/videos/category/' . $category, '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::video-list', $data);
 }
开发者ID:rinodung,项目名称:hello-video-laravel,代码行数:23,代码来源:ThemeVideoController.php

示例9: Session

require __DIR__ . '/../vendor/autoload.php';
require '../config.php';
require_once '../helpers/session.php';
require '../helpers/boot.php';
require '../helpers/functions.php';
require_once '../helpers/User.php';
require_once '../helpers/Article.php';
require_once '../helpers/Video.php';
require_once '../helpers/Level.php';
$session = new Session();
$user = NULL;
if ($session->getLoggedin()) {
    $user = User::find($session->getUsername());
    $level = Level::where('user_id', $user->id)->first();
    $video = Video::where('level', $level->level)->get();
} else {
    $video = Video::all();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />

  <title>Autism</title>
  <link href="../static/css/awe.css" rel="stylesheet">
  <link href="../static/css/player.css" rel="stylesheet">
  <script type="text/javascript" src="../static/js/jquery-1.11.3.min.js"></script>
开发者ID:helloworldprojects,项目名称:Autism,代码行数:30,代码来源:videos.php

示例10: totalVideos

 /**
  * Get total video count
  * @return mixed
  */
 protected function totalVideos()
 {
     return $this->video->where('lang', $this->getLang())->count();
 }
开发者ID:phillipmadsen,项目名称:app,代码行数:8,代码来源:VideoRepository.php

示例11:

<?php

$sidebar_videos = Video::where('active', '=', '1')->orderByRaw("RAND()")->take(6)->get();
$sidebar_posts = Post::where('active', '=', '1')->orderByRaw("RAND()")->take(6)->get();
?>

<div id="sidebar">

	<h3>Videos You May Like</h3>

	<div class="row">
		<?php 
foreach ($sidebar_videos as $video) {
    ?>
			
			<div class="col-md-6 col-sm-6 col-xs-12">
				<article class="block">
					<a class="block-thumbnail" href="<?php 
    echo $settings->enable_https ? secure_url('video') : URL::to('video');
    echo '/' . $video->id;
    ?>
">
						<div class="thumbnail-overlay"></div>
						<span class="play-button"></span>
						<img src="<?php 
    echo ImageHandler::getImage($video->image, 'medium');
    ?>
">
						<div class="details">
							<h2><?php 
    echo $video->title;
开发者ID:rinodung,项目名称:hello-video-laravel,代码行数:31,代码来源:sidebar.php

示例12: unpublishedSelfieVideos

 /**
  * Return all unpublished and unviewed selfie videos of user
  * POST /unpublishedselfievideos
  * Param email
  * @return Response
  */
 public function unpublishedSelfieVideos()
 {
     $email = Input::get('email');
     $language = Input::get('language');
     $arr = array();
     $missingParam = '';
     if ($email == '') {
         $missingParam .= 'email,';
     }
     if ($language == '') {
         $missingParam .= 'language,';
     }
     if ($missingParam != '') {
         $arr['Success'] = false;
         $arr['Status'] = 'Parameter missing: ' . rtrim($missingParam, ',');
         $arr['StatusCode'] = 400;
     } else {
         $user = User::whereEmail($email)->first();
         if ($user) {
             $userId = $user->id;
             $selfies = Video::where('user_id', $userId)->where('isunpublishedview_video', 0)->where('video_status', 0)->get(array('video_id as id', 'video_title as title', 'video_desc as description', 'video_youtube_id as youtube_id', 'video_embed as embed', 'video_url as url', 'video_thumbnail_url as thumbnail_url', 'scripture_text', 'video_language as language'));
             if (count($selfies) == 0) {
                 $arr['Success'] = false;
                 $arr['Status'] = 'Video not found';
                 $arr['StatusCode'] = 404;
             } else {
                 $arr['Success'] = true;
                 $arr['Status'] = 'OK';
                 $arr['StatusCode'] = 200;
                 $arr['language'] = $language;
                 $i = 0;
                 foreach ($selfies as $selfie) {
                     $arr['Result'][$i]['id'] = $selfie->id;
                     $arr['Result'][$i]['title'] = $selfie->title;
                     $arr['Result'][$i]['description'] = $selfie->description;
                     $arr['Result'][$i]['youtubeId'] = $selfie->youtube_id;
                     $arr['Result'][$i]['youtubeUrl'] = $selfie->url;
                     $arr['Result'][$i]['youtubeThumbnailUrl'] = $selfie->thumbnail_url;
                     $arr['Result'][$i]['scripture_text'] = $selfie->scripture_text;
                     $arr['Result'][$i]['embedCode'] = $selfie->embed;
                     $i++;
                 }
             }
         } else {
             $arr['Success'] = false;
             $arr['Status'] = 'User with this email does not exist';
             $arr['StatusCode'] = 404;
         }
     }
     return Response::json($arr);
 }
开发者ID:glennpeterm,项目名称:MyStoryWeb,代码行数:57,代码来源:VideosController.php

示例13:

				<div id="comments">
					<div id="disqus_thread"></div>
				</div>

			<?php 
}
?>

		</div>

	</div>

	<div class="col-md-2 post" id="right_sidebar">
		<h6>Recent Videos</h6>
		<?php 
$videos = Video::where('active', '=', 1)->orderBy('created_at', 'DESC')->take(4)->get();
?>
		<?php 
foreach ($videos as $video) {
    ?>
			<?php 
    include 'partials/video-block.php';
    ?>
		<?php 
}
?>
	</div>


	
		
开发者ID:rinodung,项目名称:hello-video-laravel,代码行数:27,代码来源:post.php

示例14: verListado

 public function verListado()
 {
     $videos = Video::where('estado', 'A')->get();
     $this->array_view['videos'] = $videos;
     return View::make($this->folder_name . '.listado', $this->array_view);
 }
开发者ID:tatu-carreta,项目名称:mariasanti_v2,代码行数:6,代码来源:VideoController.php

示例15:

    include 'partials/video-block.php';
    ?>
									</div>
								
							<?php 
}
?>
								</div></li>

						</ul>
					</div><!-- .mini-slider -->
				</div>

				<div class="col-md-12">
					<?php 
$premium_videos = Video::where('active', '=', 1)->where('access', '=', 'subscriber')->orderByRaw("RAND()")->take(12)->get();
?>
					<div class="mini-slider" data-index="1">
						<h6 class="no-padding">Premium Videos</h6>
						<div class="dot-nav top12">
							<div class="dot active" data-index="0"></div>
							<div class="dot" data-index="1"></div>
							<div class="dot" data-index="2"></div>
						</div>
						<ul>
							<?php 
foreach ($premium_videos as $index => $video) {
    ?>
								<?php 
    if ($index % 4 == 0 && $index != 0) {
        ?>
开发者ID:rinodung,项目名称:hello-video-laravel,代码行数:31,代码来源:home.php


注:本文中的Video::where方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。