where('language_id', '=', $language); } // 启用状态范围查询 public function scopeEnabled($query) { $query->where('status', '=', 1); } // 在售状态范围查询 public function scopeOnSale($query, bool $stat = true) { $query->where('is_sale', '=', (int)$stat); } // 上架状态范围查询 public function scopeOnShelves($query, bool $stat = true) { $query->where('is_show', '=', (int)$stat); } // 热销状态范围查询 public function scopeHot($query, bool $stat = true) { $query->where('is_hot', '=', (int)$stat); } }