예제 #1
0
파일: DataLog.php 프로젝트: withlovee/HAII
 /**
  * Scope only not-null data
  * @param query     $query  Query object
  * @param string    $type   Data type ("WATER", "RAIN")
  * @return mixed            New query object
  */
 public function scopeValid($query, $type)
 {
     if ($type == 'WATER') {
         return $query->whereNotNull('water1');
     } elseif ($type == 'RAIN') {
         return $query->whereNotNull('rain1h');
     }
     return $query;
 }