An error is reported by the static method of the TP5.1 invocation model

<?php
namespace app\index\Model;
use think\Model;
class User extends Model
{    
     public static function maxid(){
         return $this->max("id");
     }
}
use app\index\model\User;
User::maxid();

then why did you report this wrong when using this static method in the controller? What"s wrong?

Mar.09,2021

static methods can use this?? Basic knowledge fails

Menu