where('is_default', 1); } // 筛选类型 function scopeType($query, $type) { $query->where('type', $type); } }