📜  laravel where multiple conditions on single colmn - PHP代码示例

📅  最后修改于: 2022-03-11 14:54:27.226000             🧑  作者: Mango

代码示例1
//laravel
// here, i have used two different where condition on a single column
$today = Carbon::today();
$data = Users::where('type',1)
        ->where(function($query) use ($today) {
            return $query->whereDate('updated_at','!=', $today)
            ->orWhere('updated_at',null);
         })
         ->get();