add find reports by date to api
This commit is contained in:
1 parent
3c922a6627
commit
e0366b9d8c
4 files changed
+194
-1
No files matched your search
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user