$lists->where(function($query) {
$price = Currency::change($query->curr->name_en,
Session::get('cur_name'),
$query->price
);
$query->addSelect("dprice = $price");
$query->whereBetween('dprice', [
Session::get('price')['min'],
Session::get('price')['max']
]);
//$query->where('price', '>=', Session::get('price')['min'])
->where('price', '<=', Session::get('price')['max']);
});
要知道curr是关系方法
Undefined property: `Illuminate\Database\Eloquent\Builder::$curr`