add find reports by date to api

This commit is contained in:
iIronside
2022-12-20 19:24:38 +03:00
parent 3c922a6627
commit e0366b9d8c
4 changed files with 194 additions and 1 deletions

View File

@ -4,7 +4,7 @@
namespace frontend\modules\api\models;
use common\models\Reports;
use frontend\modules\card\models\UserCard;
use common\models\ReportsTask;
use yii\base\Model;
class ReportSearchForm extends Model
@ -65,4 +65,11 @@ class ReportSearchForm extends Model
return $data;
}
public function findByDate(): array
{
return Reports::find()
->where(['between', 'reports.created_at', $this->fromDate, $this->toDate])
->all();
}
}