public function updateNotificationStatus($userid)
{
//update the status to 1 when activity is seen
$results= DB::table('tablename')
->where('status', 0)
->whereIn('id', function($query) use ($userid)
{
$query->select(DB::raw('id'))
->from('tablename')
->where(function($q) use ($userid) {
$q->where('user_id', $userid)
->orWhere('staff_id', $userid);
})->get();
})
->update(['status' => 1]);
return $results;
}
0 comments:
Post a Comment