API:возможность получить репорты по user_id, в промежутке от fromDate до toDate
This commit is contained in:
parent
d642e32811
commit
85760914eb
@ -39,13 +39,12 @@ class ReportSearchForm extends Model
|
|||||||
{
|
{
|
||||||
$queryBuilder = Reports::find()
|
$queryBuilder = Reports::find()
|
||||||
->with('task')
|
->with('task')
|
||||||
->andWhere(['between', 'reports.created_at', $this->fromDate, $this->toDate, $this->user_id])
|
->andWhere(['between', 'reports.created_at', $this->fromDate, $this->toDate])
|
||||||
->limit($this->limit)
|
->limit($this->limit)
|
||||||
->offset($this->offset);
|
->offset($this->offset);
|
||||||
|
|
||||||
if(isset($this->user_id)) {
|
if(isset($this->user_id)) {
|
||||||
$userCardId = UserCard::findByUserId($this->user_id)->id;
|
$queryBuilder->andWhere(['user_card_id' => $this->user_id]);
|
||||||
$queryBuilder->andWhere(['user_card_id' => $userCardId]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = $queryBuilder->asArray()->all();
|
$data = $queryBuilder->asArray()->all();
|
||||||
|
Loading…
Reference in New Issue
Block a user