コード例 #1
0
ファイル: Tasks.php プロジェクト: yogamaya/Checksystem
 public static function getTeamsSolvedTask($task_id)
 {
     return AcceptedRequests::find()->joinWith("user")->where(["task_id" => $task_id])->all();
 }
コード例 #2
0
 /**
  * Finds the AcceptedRequests model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return AcceptedRequests the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = AcceptedRequests::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
コード例 #3
0
ファイル: Users.php プロジェクト: yogamaya/Checksystem
 public function getSolvedTasks()
 {
     $tasks = AcceptedRequests::find()->where(['user_id' => $this->id])->all();
     $data = [];
     foreach ($tasks as $task) {
         $data[$task->task_id] = 1;
     }
     return $data;
 }