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


PHP Task::whereIn方法代码示例

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


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

示例1: index

 public function index()
 {
     /** @var Collection $lines */
     $lines = Line::where('visible', true)->orderBy('list_order', 'asc')->get();
     $lineIds = array_map(function ($line) {
         return $line['id'];
     }, $lines->all());
     $dateStart = new \DateTime('-4 day');
     $dateEnd = new \DateTime('+4 day');
     $tasks = Task::whereIn('line_id', $lineIds)->whereBetween('date', [$dateStart->format('Y-m-d'), $dateEnd->format('Y-m-d')])->get();
     return view('nichirei.index', ['lines' => $lines, 'tasks' => $tasks, 'dateStart' => $dateStart, 'dateEnd' => $dateEnd]);
 }
开发者ID:shatee,项目名称:nichirei-benri,代码行数:12,代码来源:NichireiController.php

示例2: userTasks

 public static function userTasks()
 {
     $ids = static::current()->pluck('user_id')->unique();
     $container = collect();
     foreach ($ids as $id) {
         $subContainer = collect();
         $user = User::find($id);
         $subContainer->tasks = Task::whereIn('id', $user->currentTasks())->pluck('slug');
         $subContainer->name = $user->name;
         $container->push($subContainer);
     }
     return $container;
 }
开发者ID:PLANKandre,项目名称:dashboard,代码行数:13,代码来源:WorkWheel.php

示例3: todayActivityInProgress

 /**
  * Retrieves information for volunteer's activity of the day that is in progress.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return  JSON  array of status of activity with activity
  */
 public function todayActivityInProgress(Request $request)
 {
     if ($request->get('token') != null) {
         // Get Authenticated User
         $authenticatedUser = JWTAuth::setToken($request->get('token'))->authenticate();
         $id = $authenticatedUser->volunteer_id;
         // Retrieve Activties within today
         $todayactivities = Activity::whereBetween('datetime_start', [Carbon::now()->startOfDay(), Carbon::now()->endOfDay()])->lists('activity_id');
         //echo count($todayactivities);
         // Retrieve Related Activties within today related to volunteer
         $groupStatus = collect(['pick-up', 'at check-up', 'check-up completed']);
         $relatedActivty = Task::whereIn('activity_id', $todayactivities)->where('volunteer_id', $id)->whereIn('status', $groupStatus)->lists('activity_id');
         $taskStatus = Task::whereIn('activity_id', $todayactivities)->whereIn('status', $groupStatus)->where('volunteer_id', $id)->value('status');
         // Retrieve Activity details
         $activityToReturn = Activity::with('departureCentre', 'arrivalCentre')->whereIn('activity_id', $relatedActivty)->first();
         return response()->json(compact('activityToReturn', 'taskStatus'));
     } else {
         $status = ["Missing parameter"];
         return response()->json(compact('status'));
     }
 }
开发者ID:jonnylow,项目名称:CrowdSourcingApplicationWeb,代码行数:27,代码来源:VolunteerController.php


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