title = "Device" url = "/device" layout = "Dashboard" is_hidden = 0 [session] security = "user" allowedUserGroups[] = "admin" allowedUserGroups[] = "supplier" redirect = "dashboard/login" == vendor; $devices = Device::selectRaw('device, COUNT(*) as total')->where('vendor', $user->vendor)->groupBy('device')->orderBy('total', 'desc'); if ($from != null) { $devices->where('created_at', '>=', $from); } if ($to != null) { $devices->where('created_at', '<=', $to); } $this['devices'] = $devices->get(); $this['all_device'] = Device::where('vendor', $user->vendor)->count(); $device_by_date = Device::selectRaw('device, COUNT(*) as total')->where('vendor', $user->vendor)->groupBy('device')->orderBy('total', 'asc'); if ($from != null) { $device_by_date->where('created_at', '>=', $from); } if ($to != null) { $device_by_date->where('created_at', '<=', $to); } $this['device_by_date'] = $device_by_date->get(); } } ?> ==
| Device | Total |
|---|---|
| {{ device.device }} | {{ device.total }} |