vendredi 20 novembre 2015

get min value not 0 in laravel

I'm trying to get the min value ignoring 0 inside a laravel model using mysql nullif. I'm using this code with no luck:

static function etomin($month, $year) {

    return day::where(\DB::raw('month(fecha)'), $month)
        ->where(\DB::raw('year(fecha)'), $year)->get()
        ->min(NULLIF('evotranspiration', 0))
}

I really appreciate any help.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire