mardi 24 novembre 2015

MONGODB AND LARAVEL 5.1. I need to get all the documents updated today, how can I do that?

I need to get all the documents where updated_at is the same date a today or yesterday, how can I do that?

This is my current code:

$yesterday = new DateTime('-1 days');
$yesterday = $fecha->format('Y-m-d');
$yesterday = new MongoDate(strtotime($yesterday.'00:00:00'));

$date=CampaignLog::where('campaign_id',$id)->where('updated_at','=', $yesterday)->get(array('data'));



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire