update([ 'u' => 0, 'd' => 0 ]); break; // expire day case 1: $startAt = strtotime(date('Y-m-d', time())); $user->where('expired_at', '>=', $startAt) ->where('expired_at', '<', $startAt + 24 * 3600) ->update([ 'u' => 0, 'd' => 0 ]); } } }