change some thing

This commit is contained in:
2025-08-12 10:43:44 +03:30
parent 6309254884
commit b7514a58ba
3 changed files with 23 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ class LoginToProvinceController extends Controller
{
$province_ip = Province::query()
->Where('id', '=', $request->province_id)
->value('ip_address');
->value('ip');
$data = [
'user_id' => auth()->user()->id,

View File

@@ -31,13 +31,32 @@ class ReportService
// ->orderByDesc(DB::raw('DATE(calldate)'))
// ->get();
return DataTableFacade::run(
$data = DataTableFacade::run(
$query,
$request,
allowedFilters: ['*'],
allowedSortings: ['*'],
allowedGroupBy: ['d']
);
$totals = [
'd' => 'TOTAL',
'total' => $data->sum('total'),
'teh4' => $data->sum('teh4'),
'teh5' => $data->sum('teh5'),
'os4' => $data->sum('os4'),
'os5' => $data->sum('os5'),
'ok' => $data->sum('ok'),
'nok' => $data->sum('nok'),
'b10' => $data->sum('b10'),
'dnd' => $data->sum('dnd'),
'trans' => $data->sum('trans'),
'all' => $data->sum('all'),
'avg' => round($data->avg('avg'), 2),
];
$data->push($totals);
return $data;
}
public function peopleMessages(Request $request)

View File

@@ -216,8 +216,9 @@ Route::prefix('server')->group(function () {
->name('verifyAuthentication.')
->controller(VerifyAuthenticationController::class)
->group(function () {
Route::get('/', 'login')->name('login');
Route::post('/', 'login')->name('login');
});
Route::middleware('auth')
->prefix('report')
->name('report.')