Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. foreach ($data->monitoringShiftEngine as $index => $row) {
  2. $resDowntimes[$index] = DB::table('loss_times as D')
  3. ->select('D.no', 'D.by',
  4. DB::raw('IFNULL((SELECT CONCAT(IFNULL(SUM(MD.total_minutes),0),"|", SUM(IFNULL(MD.total_seconds,0))) FROM monitoring_down_times AS MD WHERE MD.monitoring_line_id = "'.$id.'" AND MD.loss_time_id = D.id AND MD.port = "'.$row->port.'"), "0|0") as total_times'))
  5. ->whereRaw('(SELECT ME.isReset FROM monitoring_engines as ME where ME.monitoring_line_id = "'.$id.'" AND ME.port = "'.$row->port.'") <> 1 OR( (SELECT ME.isReset FROM monitoring_engines as ME where ME.monitoring_line_id = "'.$id.'" AND ME.port = "'.$row->port.'" ) = 1 AND MD.updated_at > "'.self::parseTime($data->start).'" AND MD.updated_at < "'.self::parseTime($data->stop).'" )')
  6. ->get();
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement