backend/models/search/UsersSearch.php
/**
     * Function returns dataProvider (statistics for Users)
     *
     * @return SqlDataProvider
     */
Function returns dataProvider (statistics for Users)
@return SqlDataProvider
Function returns dataProvider ( statistics for Users ) @return SqlDataProvider
public function totalStatistic()
    {
        $sql = "
            SELECT count(*) as cnt, 'day' as period, 1 as sortf
            FROM {{%users}}
            WHERE user_created BETWEEN :today_begin AND :today_end
              UNION
            SELECT count(*) as cnt, 'week' as period, 2 as sortf
            FROM {{%users}}
            WHERE user_created BETWEEN :week_begin AND :week_end
              UNION
            SELECT count(*) as cnt, 'mnth' as period, 3 as sortf
            FROM {{%users}}
            WHERE user_created BETWEEN :mnth_begin AND :mnth_end
            ORDER BY sortf
        ";
        $dataProvider = new SqlDataProvider([
            'sql' => $sql,
            'params' => Functions::dateInfo(),
            'pagination' => false,
        ]);
        return $dataProvider;
    }
public function totalStatistic ( ) { $ sql = " 
            SELECT count(*) as cnt, 'day' as period, 1 as sortf
            FROM {{%users}}
            WHERE user_created BETWEEN :today_begin AND :today_end
              UNION
            SELECT count(*) as cnt, 'week' as period, 2 as sortf
            FROM {{%users}}
            WHERE user_created BETWEEN :week_begin AND :week_end
              UNION
            SELECT count(*) as cnt, 'mnth' as period, 3 as sortf
            FROM {{%users}}
            WHERE user_created BETWEEN :mnth_begin AND :mnth_end
            ORDER BY sortf
         " ; $ dataProvider = new SqlDataProvider ( [ 'sql' => $ sql , 'params' => Functions :: dateInfo ( ) , 'pagination' => false , ] ) ; return $ dataProvider ; }
Function returns dataProvider (statistics for Users)
 @return SqlDataProvider
Function returns dataProvider ( statistics for Users ) @return SqlDataProvider
/*
            'sort'=> [
                'attributes' => [
                    'cnt',
                    'period',
                ]
            ],
            */