我正在使用laravel 5.2框架,但在此WhereBetween中无法正常工作。我使用价格范围,价格从500到4000开始。当我执行查询获取空记录但当我删除WhereBetween()
然后获取所有记录。请建议我如何解决这个问题。
$query = Property::query();
$query->select('properties.property_id', 'properties.property_title', 'properties.description', 'properties.latitude', 'properties.longitude', 'properties.city_name', 'properties.state_name');
$query->leftjoin('properties_base_season_price_transactions', 'properties_base_season_price_transactions.parent_id', '=', 'properties.property_id');
$query->leftjoin('properties_availability', 'properties_availability.property_id', '=', 'properties.property_id');
$query->where('properties.property_category_id', $post_data['categoryid']);
$query->where('properties.property_sub_category_id', $post_data['subcategoryid']);
$query->where('properties.city_name', 'LIKE' , '%'.$post_data['city'].'%');
$query->whereBetween('properties_base_season_price_transactions.price', [500, 4444]);
$query_output = $query->get()->toArray();
答案 0 :(得分:0)
ess
尝试
whereBetween