add find reports by date to api
This commit is contained in:
@ -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