Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach ($data->monitoringShiftEngine as $index => $row) {
- $resDowntimes[$index] = DB::table('loss_times as D')
- ->select('D.no', 'D.by',
- 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'))
- ->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).'" )')
- ->get();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement