Compare commits
1 Commits
5edb061a24
...
feature/Po
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ac07692a2 |
@@ -13,7 +13,7 @@ class EncodePolyLineCommand extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'app:encode-poly-line-command';
|
||||
protected $signature = 'polyline:encode';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
|
||||
@@ -7,13 +7,11 @@ use App\Facades\DataTable\DataTableFacade;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Traits\ApiResponse;
|
||||
use App\Models\City;
|
||||
use App\Models\CMMSMachine;
|
||||
use App\Models\Mission;
|
||||
use App\Models\Province;
|
||||
use App\Services\Cartables\Mission\Report\ReportMachineService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use PhpOffice\PhpSpreadsheet\Exception;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
@@ -149,33 +147,4 @@ class ReportMachineController extends Controller
|
||||
// ->get(['id', 'name_fa'])
|
||||
]);
|
||||
}
|
||||
|
||||
public function machineTypeDetailsReport(Request $request)
|
||||
{
|
||||
$machineIds = CMMSMachine::query()->where('car_type', '=', $request->query('car_type'))->pluck('machine_id');
|
||||
return DataTableFacade::run(
|
||||
Mission::query()->whereIn('machine_id', $machineIds),
|
||||
$request,
|
||||
allowedFilters: ['*'],
|
||||
allowedSortings: ['*'],
|
||||
allowedSelects: [
|
||||
'id', 'province_id', 'province_name', 'city_id', 'city_name',
|
||||
'end_km', 'km', 'driver_name', 'state_name', 'station_name'
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function machineDriverDetailsReport(Request $request)
|
||||
{
|
||||
return DataTableFacade::run(
|
||||
Mission::query()->where('driver_id', '=', $request->query('driver_id')),
|
||||
$request,
|
||||
allowedFilters: ['*'],
|
||||
allowedSortings: ['*'],
|
||||
allowedSelects: [
|
||||
'id', 'province_id', 'province_name', 'city_id', 'city_name',
|
||||
'end_km', 'km', 'driver_name', 'state_id', 'station_name'
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ class UpdateRequest extends FormRequest
|
||||
{
|
||||
return [
|
||||
function (Validator $validator) {
|
||||
if (strtotime($this->violation->exit_time) < strtotime($this->enter_time)) {
|
||||
if (strtotime($this->enter_time) < strtotime($this->violation->exit_time)) {
|
||||
$validator->errors()->add(
|
||||
'time',
|
||||
'زمان پایان ماموریت باید بعد از زمان شروع ماموریت باشد.'
|
||||
|
||||
@@ -83,7 +83,7 @@ class ReportMachineService
|
||||
SUM(m.end_km - m.km) AS func
|
||||
FROM missions m
|
||||
JOIN cmms_machines cm ON cm.id = m.machine_id
|
||||
WHERE m.state_id = 4 AND m.start_time >= :from AND m.finish_time <= :to AND m.province_id = :province_id
|
||||
WHERE m.state_id = 4 AND m.start_time >= :from AND m.finish_time <= :to AND province_id = :province_id
|
||||
GROUP BY cm.car_type;";
|
||||
|
||||
return DB::select($sql, [
|
||||
|
||||
@@ -575,8 +575,6 @@ Route::prefix('missions')
|
||||
Route::get('/machine_details_report', 'machineDetailsReport')->name('machineDetailsReport');
|
||||
Route::get('/country_machine_drivers_activity', 'countryMachineDriversActivity')->name('countryMachineDriversActivity');
|
||||
Route::get('/province_machine_drivers_activity', 'provinceMachineDriversActivity')->name('provinceMachineDriversActivity');
|
||||
Route::get('/machine_driver_details_report', 'machineDriverDetailsReport')->name('machineDriverDetailsReport');
|
||||
Route::get('/machine_type_details_report', ' machineTypeDetailsReport')->name('machineTypeDetailsReport');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user