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