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


PHP Task::whereId方法代码示例

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


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

示例1: update

 /**
  * To update task
  *
  * @param $task
  *
  * @return mixed
  */
 public function update($task)
 {
     return Task::whereId($task['id'])->update(['name' => $task['name'], 'description' => $task['description'], 'date' => Carbon::parse($task['date']), 'time' => $task['time']]);
 }
开发者ID:princesust,项目名称:SUN-TASK,代码行数:11,代码来源:TaskRepository.php

示例2: updateSingleTask

 public function updateSingleTask(Project $project, $id)
 {
     $data = array();
     $data = splitString($id);
     $id = $data[0];
     $statusName = $data[2];
     $currentStatus = $data[3];
     $task = new Task();
     $affectedRows = $task->whereId($id)->orderBy('id', 'desc')->first();
     //dd($affectedRows->task_dev);
     $datetime = currentTimestamp($currentStatus);
     if ($currentStatus == "start" or $currentStatus == "restart") {
         $newStatus = "pause";
     } elseif ($currentStatus == "notStart" or $currentStatus == "end") {
         $newStatus = "start";
     } elseif ($currentStatus == "pause") {
         $newStatus = "restart";
     }
     if ($statusName == "status_des") {
         $task->task_designs = $datetime;
         $task->status_task_designs = $newStatus;
         $task->task_prod = $affectedRows->task_prod;
         $task->status_task_prod = $affectedRows->status_task_prod;
         $task->task_dev = $affectedRows->task_dev;
         $task->status_task_dev = $affectedRows->status_task_dev;
         $task->project_id = $affectedRows->project_id;
         $task->save();
     }
     if ($statusName == "status_dev") {
         $task->task_designs = $affectedRows->task_designs;
         $task->status_task_designs = $affectedRows->status_task_designs;
         $task->task_prod = $affectedRows->task_prod;
         $task->status_task_prod = $affectedRows->status_task_prod;
         $task->task_dev = $datetime;
         $task->status_task_dev = $newStatus;
         $task->project_id = $affectedRows->project_id;
         $task->save();
     }
     if ($statusName == "status_prod") {
         $task->task_designs = $affectedRows->task_designs;
         $task->status_task_designs = $affectedRows->status_task_designs;
         $task->task_prod = $datetime;
         $task->status_task_prod = $newStatus;
         $task->task_dev = $affectedRows->task_dev;
         $task->status_task_dev = $affectedRows->status_task_dev;
         $task->project_id = $affectedRows->project_id;
         $task->save();
     }
     return view('projects.show', compact('project'));
 }
开发者ID:berkapavel,项目名称:Laravel5-Time-Tracker-Project-manager,代码行数:50,代码来源:PagesController.php


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