无法在查询laravel 5.0中调用列

时间:2015-12-28 12:44:23

标签: php laravel laravel-5

$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`

0 个答案:

没有答案