public function actionPrint($ticket_id) { $this->layout = 'clean'; $ticket = tickets::find()->where(['id' => $ticket_id, 'open_user_id' => Yii::$app->user->id])->one(); if ($ticket) { return $this->render('print', ['ticket' => $ticket]); } else { echo 'Неверный номер заявки'; } }
public function actionSaveTicketComment($ticket_id, $ticket_comment) { if ($ticket_id && ($ticket = tickets::findOne($ticket_id))) { $ticket->close_text = $ticket_comment; $ticket->close_date = date('Y-m-d'); if ($ticket->save()) { //echo 'Сохранено' . $close; echo 'Сохранено'; } else { echo 'Ошибка сохранения комментария'; } //print_r($ticket -> getErrors()); } }