console/controllers/UserController.php
public function actionStat($user = null)
    {
        if ($user === null) {
            $count = User::find()->count();
            echo "Total number of user(s): " . $count . "\n";
            if ($count == 0) {
                return static::EXIT_CODE_NORMAL;
            }
            $last = User::find()->orderByCreatedAt(SORT_DESC)->one();
            /* @var $last User */
            echo "Latest user (" . $last->getID() . ") registered at " . $last->getCreatedAt() . "\n";
            return static::EXIT_CODE_NORMAL;
        }
        $user = $this->getUser($user);
        return static::EXIT_CODE_NORMAL;
    }
public function actionStat($user = null)
    {
        if ($user === null) {
            $count = User::find()->count();
            echo "Total number of user(s): " . $count . "\n";
            if ($count == 0) {
                return static::EXIT_CODE_NORMAL;
            }
            $last = User::find()->orderByCreatedAt(SORT_DESC)->one();
            /* @var $last User */
            echo "Latest user (" . $last->getID() . ") registered at " . $last->getCreatedAt() . "\n";
            return static::EXIT_CODE_NORMAL;
        }
        $user = $this->getUser($user);
        return static::EXIT_CODE_NORMAL;
    }
public function actionStat ( $ user = null ) { if ( $ user === null ) { $ count = User :: find ( ) -> count ( ) ; echo "Total number of user(s): " . $ count . "\n" ; if ( $ count == 0 ) { return static :: EXIT_CODE_NORMAL ; } $ last = User :: find ( ) -> orderByCreatedAt ( SORT_DESC ) -> one ( ) ; /* @var $last User */ echo "Latest user (" . $ last -> getID ( ) . ") registered at " . $ last -> getCreatedAt ( ) . "\n" ; return static :: EXIT_CODE_NORMAL ; } $ user = $ this -> getUser ( $ user ) ; return static :: EXIT_CODE_NORMAL ; }
Show statistics.
@param User|string|integer $user User ID.
@return int
Show statistics .