在模型中添加示范 1234567class User extends BaseModel{ use SoftDeletes; public function newQuery(){ global $_W; return parent::newQuery()->where("tenant_id",$_W["tenant_id"]); }} 这样在使用ORM的时候将会自动加上 ->where("tenant_id",x)