From 56ec8d8b13a8eb50e1145ef244312ab6422691c3 Mon Sep 17 00:00:00 2001 From: iIronside Date: Thu, 19 Jan 2023 16:40:01 +0300 Subject: [PATCH] fix reports --- frontend/modules/api/controllers/ReportsController.php | 1 + frontend/modules/api/models/ReportSearchForm.php | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/modules/api/controllers/ReportsController.php b/frontend/modules/api/controllers/ReportsController.php index dab0e8d..2aca223 100755 --- a/frontend/modules/api/controllers/ReportsController.php +++ b/frontend/modules/api/controllers/ReportsController.php @@ -159,6 +159,7 @@ class ReportsController extends ApiController // return $reportsModel; $reports = $reportsModel->reportsByDate(); + return $reports; return ArrayHelper::toArray($reports , [ 'common\models\Reports' => [ 'date' => 'created_at', diff --git a/frontend/modules/api/models/ReportSearchForm.php b/frontend/modules/api/models/ReportSearchForm.php index b2ae7f3..10be209 100755 --- a/frontend/modules/api/models/ReportSearchForm.php +++ b/frontend/modules/api/models/ReportSearchForm.php @@ -71,8 +71,7 @@ class ReportSearchForm extends Model { return Reports::find()->with('task') ->where(['reports.user_card_id' => $this->user_card_id]) - ->where(['reports.user_card_id' => $this->user_card_id]) - ->where(['between', 'reports.created_at', $this->fromDate, $this->toDate]) + ->andWhere(['between', 'reports.created_at', $this->fromDate, $this->toDate]) ->asArray()->all(); } } \ No newline at end of file