Using $this when not in object context错误原因及解决办法董德多2021年7月20日0 在php中出现Using $this when not in object context的原因是在静态方法中使用$this或者直接调用非静态的方法。 错误代码1: //thinkphp 模型类class StudentCharge extends Model{ public static function getCharges(