diff --git a/backend/modules/reports/controllers/ReportsController.php b/backend/modules/reports/controllers/ReportsController.php index 69f7cdd..c26b49f 100755 --- a/backend/modules/reports/controllers/ReportsController.php +++ b/backend/modules/reports/controllers/ReportsController.php @@ -88,7 +88,7 @@ class ReportsController extends Controller public function actionCalendar($user_id) { $searchModel = new ReportsSearch(); - $searchModel->user_card_id = $user_id; + $searchModel->user_id = $user_id; $dataProvider = $searchModel->search([]); diff --git a/backend/modules/reports/models/ReportsSearch.php b/backend/modules/reports/models/ReportsSearch.php index 47f18c8..3bfa2fe 100755 --- a/backend/modules/reports/models/ReportsSearch.php +++ b/backend/modules/reports/models/ReportsSearch.php @@ -20,7 +20,7 @@ class ReportsSearch extends Reports public function rules() { return [ - [['id', 'created_at', 'user_card_id'], 'integer'], + [['id', 'created_at', 'user_card_id', 'user_id'], 'integer'], [['today', 'difficulties', 'tomorrow', 'fio'], 'safe'], ]; } @@ -60,7 +60,7 @@ class ReportsSearch extends Reports $this->load($params); if (isset($params['user_id'])) { - $this->user_card_id = $params['user_id']; + $this->user_id = $params['user_id']; } if (isset($params['year'])) { $query->andFilterWhere(['=', 'YEAR(reports.created_at)', $params['year']]); diff --git a/backend/modules/reports/views/ajax/_gridViewAllUsers.php b/backend/modules/reports/views/ajax/_gridViewAllUsers.php index 1daf874..b9ac080 100755 --- a/backend/modules/reports/views/ajax/_gridViewAllUsers.php +++ b/backend/modules/reports/views/ajax/_gridViewAllUsers.php @@ -17,7 +17,7 @@ echo GridView::widget([ 'attribute' => 'user_card_id', 'value' => function ($model) { return Html::a(Reports::getFio($model) . ' ' . Html::tag('i', null, ['class' => 'far fa-calendar-alt']), - \yii\helpers\Url::base(true) . '/reports/reports/calendar?user_id=' . $model['user_card_id'], ['data-pjax' => 0]); + \yii\helpers\Url::base(true) . '/reports/reports/calendar?user_id=' . $model['user_id'], ['data-pjax' => 0]); }, ], [ diff --git a/common/models/Reports.php b/common/models/Reports.php index bf8e629..3e6befc 100755 --- a/common/models/Reports.php +++ b/common/models/Reports.php @@ -137,7 +137,6 @@ class Reports extends \yii\db\ActiveRecord public static function getFio($data) { - //Debug::dd($data); $user_card = UserCard::findOne(['id_user' => $data->user_id]); return $user_card->fio ?? null; }