Esempio n. 1
0
 /**
  * Scope "today"
  * 
  * @param  mixed $query
  * @return mixed
  */
 public function scopeToday($query)
 {
     $sql = 'date(created_at) = date(now())';
     if (db_is('sqlite')) {
         $sql = "date(created_at) = date('now')";
     }
     return $query->whereRaw($sql);
 }
Esempio n. 2
0
 /**
  * @param $query
  * @return mixed
  */
 public function scopeToday($query)
 {
     // mysql
     $raw = "date(created_at) = date(now())";
     if (db_is('sqlite')) {
         $raw = "date(created_at) = date(date('now'))";
     }
     return $query->whereRaw($raw);
 }