where('show', 1) // 只获取 show = 1 的 Banner ->where('position', $position) // 根据 position 过滤 ->where('dist_id', getDistId()) // 根据 dist_id 过滤 ->first(); } // 添加一个静态方法获取符合条件的多个Banner public static function getBanners($position = 1, $limit = 10) { return self::where('show', 1) // 只获取 show = 1 的 Banner ->where('position', $position) // 根据 position 过滤 ->where('dist_id', getDistId()) // 根据 dist_id 过滤 ->limit($limit) ->get(); } }