Merge branch 'feature/CreateTotalReport' into 'develop'
change some thing See merge request witel-back-end/crm!24
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.')
|
||||
|
||||
Reference in New Issue
Block a user