1 写一个基类2 基类中 use YourTrait3 写一个子类 extends 基类4 子类中覆写 YourTrait 中的同名方法$query = parent::scopeOfParams($query, $params);// 子类中的相关逻辑return $query;