доработан виджет, добавлен календарь отчетов всех за месяц

This commit is contained in:
q6q9
2021-09-15 11:26:06 +03:00
parent d642e32811
commit 2dbc33a8f3
11 changed files with 248 additions and 130 deletions

View File

@@ -10,17 +10,22 @@ use yii\web\Response;
class AjaxController extends \yii\web\Controller
{
public function actionGetReportsForDayByDate($user_id, $date)
public function actionGetReportsForDayByDate($date, $user_id = null)
{
$searchModel = new ReportsSearch();
$params = ['ReportsSearch' => ['created_at' => $date], 'user_id' => $user_id];
$params = ['ReportsSearch' => ['created_at' => $date]];
$view = '_gridViewAllUsers';
if ($user_id){
$params['user_id'] = $user_id;
$view = '_gridViewOneUser';
}
$dataProvider = $searchModel->search($params);
return $this->render('_gridView', [
'dataProvider' => $dataProvider
return $this->render($view, [
'dataProvider' => $dataProvider,
]);
}
public function actionGetReportsForMonthByIdYearMonth($user_id, $year, $month)
public function actionGetReportsForMonthByIdYearMonth($year, $month, $user_id=null)
{
$searchModel = new ReportsSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);