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
@@ -123,4 +123,17 @@ class Reports extends \yii\db\ActiveRecord
|
||||
$user_card = UserCard::findOne(['id' => $data->user_card_id]);
|
||||
return $user_card->fio;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getReportsTask()
|
||||
{
|
||||
return $this->hasMany(ReportsTask::className(), ['report_id' => 'id']);
|
||||
}
|
||||
|
||||
public function calculateOrderTime()
|
||||
{
|
||||
return ReportsTask::find()->where(['report_id' => $this->id])->sum('hours_spent');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user