src/models/UserOnline.php
public static function getList()
    {
        $time = time();
        $return = [];
        
        foreach (self::find()->with('user')->all() as $item) {
            /* @var $item \luya\admin\models\UserOnline */
            $inactiveSince = ($time - $item->last_timestamp);
            $return[] = [
                'firstname' => $item->user->firstname,
                'lastname' => $item->user->lastname,
                'email' => $item->user->email,
                'last_timestamp' => $item->last_timestamp,
                'is_active' => ($inactiveSince >= (3*60)) ? false : true,
                'inactive_since' => round(($inactiveSince / 60)).' min',
                'lock_description' => Module::t($item->lock_translation, empty($item->lock_translation_args) ? [] : Json::decode($item->lock_translation_args)),
            ];
        }

        return $return;
    }
public static function getList()
    {
        $time = time();
        $return = [];
        
        foreach (self::find()->with('user')->all() as $item) {
            /* @var $item \luya\admin\models\UserOnline */
            $inactiveSince = ($time - $item->last_timestamp);
            $return[] = [
                'firstname' => $item->user->firstname,
                'lastname' => $item->user->lastname,
                'email' => $item->user->email,
                'last_timestamp' => $item->last_timestamp,
                'is_active' => ($inactiveSince >= (3*60)) ? false : true,
                'inactive_since' => round(($inactiveSince / 60)).' min',
                'lock_description' => Module::t($item->lock_translation, empty($item->lock_translation_args) ? [] : Json::decode($item->lock_translation_args)),
            ];
        }

        return $return;
    }
public static function getList ( ) { $ time = time ( ) ; $ return = [ ] ; foreach ( self :: find ( ) -> with ( 'user' ) -> all ( ) as $ item ) { /* @var $item \luya\admin\models\UserOnline */ $ inactiveSince = ( $ time - $ item -> last_timestamp ) ; $ return [ ] = [ 'firstname' => $ item -> user -> firstname , 'lastname' => $ item -> user -> lastname , 'email' => $ item -> user -> email , 'last_timestamp' => $ item -> last_timestamp , 'is_active' => ( $ inactiveSince >= ( 3 * 60 ) ) ? false : true , 'inactive_since' => round ( ( $ inactiveSince / 60 ) ) . ' min' , 'lock_description' => Module :: t ( $ item -> lock_translation , empty ( $ item -> lock_translation_args ) ? [ ] : Json :: decode ( $ item -> lock_translation_args ) ) , ] ; } return $ return ; }
Get the user online list.

@return array
Get the user online list .