/** * Creates a new AcceptedRequests model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new AcceptedRequests(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model]); } }
public static function givePoints($team, $task) { if (Tasks::isTaskAccepted($team, $task)) { return true; } $ac_req = new AcceptedRequests(); $ac_req->user_id = $team; $ac_req->task_id = $task; return $ac_req->save(); }