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


PHP Course::whereIn方法代码示例

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


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

示例1: show

 public function show()
 {
     // TODO: Replace with actual
     $popular = new \stdClass();
     $popular->name = "Populares";
     $popular->courses = Course::whereIn('slug', ['netflix', 'email', 'homebanking-caixa'])->get();
     $best_rated = new \stdClass();
     $best_rated->name = "Melhor avaliados";
     $best_rated->courses = Course::whereIn('slug', ['google-maps', 'conheca-televisao-meo', 'email'])->get();
     $courses = [$popular, $best_rated];
     $breadcrumbs = array(action('HomeController@show') => 'Início');
     return view('home', compact('breadcrumbs', 'courses'));
 }
开发者ID:joaopluis,项目名称:oldschool,代码行数:13,代码来源:HomeController.php

示例2: getRecords

 public function getRecords(SearchCourseRequest $request)
 {
     //Get level records
     $levelString = implode(',', $request->input('level'));
     $levels = explode(',', $levelString);
     //Get Method records
     $methodString = implode(',', $request->input('method'));
     $methods = explode(',', $methodString);
     //Get Paper records
     $paperString = implode(',', $request->input('paper'));
     $papers = explode(',', $paperString);
     //Get Element records
     $elementString = implode(',', $request->input('element'));
     $elements = explode(',', $elementString);
     //Get Centre records
     $centreString = implode(',', $request->input('centre'));
     $centres = explode(',', $centreString);
     $courseLevels = Course::whereIn('level_id', $levels)->whereIn('method_id', $methods)->whereIn('paper_id', $papers)->whereIn('element_id', $elements)->whereIn('centre_id', $centres)->get();
     $centreList = Centre::whereIn('id', $centres)->get();
     return view('acca.results')->with('centres', $centreList)->with('courses', $courseLevels);
 }
开发者ID:KaplanDigitalMarketing,项目名称:Timetables,代码行数:21,代码来源:AccaController.php


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