after a series of bug fixes plus Non MNO logic for Sender IDs, unfinished leave management and holiday modules
This commit is contained in:
@@ -27,7 +27,7 @@ class SenderIdController extends Controller
|
||||
->join('staff_members AS staffmodify', 'staffmodify.id', '=', 'sender_ids.last_modified_by')
|
||||
->join('network_operators', 'network_operators.id', '=', 'sender_ids.network_id')
|
||||
->join('clients', 'clients.id', '=', 'sender_ids.client_id')
|
||||
->select('sender_ids.id', 'clients.name AS clientName', 'network_operators.name AS networkName', 'network_operators.country', 'sender_ids.senderid', 'sender_ids.status', 'sender_ids.network_id', 'network_operators.country','sender_ids.remarks', 'staffcreate.name As createdBy', 'staffmodify.name AS modifiedBy')
|
||||
->select('sender_ids.id', 'clients.name AS clientName', 'network_operators.name AS networkName', 'network_operators.country', 'sender_ids.senderid', 'sender_ids.status', 'sender_ids.network_id', 'network_operators.country','sender_ids.remarks', 'staffcreate.name As createdBy','sender_ids.direct_mno', 'staffmodify.name AS modifiedBy')
|
||||
->orderBy('sender_ids.senderid', 'ASC')
|
||||
->paginate(15);
|
||||
|
||||
@@ -38,8 +38,8 @@ class SenderIdController extends Controller
|
||||
->join('staff_members AS staffmodify', 'staffmodify.id', '=', 'sender_ids.last_modified_by')
|
||||
->join('network_operators', 'network_operators.id', '=', 'sender_ids.network_id')
|
||||
->join('clients', 'clients.id', '=', 'sender_ids.client_id')
|
||||
->select('sender_ids.id', 'clients.name AS clientName', 'network_operators.name AS networkName', 'network_operators.country', 'sender_ids.senderid', 'sender_ids.status', 'sender_ids.network_id', 'network_operators.country','sender_ids.remarks', 'staffcreate.name As createdBy', 'staffmodify.name AS modifiedBy')
|
||||
->whereRaw("sender_ids.senderid LIKE '%$keyword%' OR sender_ids.status LIKE '%$keyword%' OR network_operators.name LIKE '%$keyword%' OR network_operators.country LIKE '%$keyword%' OR staffcreate.name LIKE '%$keyword%' OR staffmodify.name LIKE '%$keyword%' OR clients.name LIKE '%$keyword%'")
|
||||
->select('sender_ids.id', 'clients.name AS clientName', 'network_operators.name AS networkName', 'network_operators.country', 'sender_ids.senderid', 'sender_ids.status', 'sender_ids.network_id', 'network_operators.country','sender_ids.remarks', 'staffcreate.name As createdBy', 'sender_ids.direct_mno', 'staffmodify.name AS modifiedBy')
|
||||
->whereRaw("sender_ids.senderid LIKE '%$keyword%' OR sender_ids.status LIKE '%$keyword%' OR network_operators.name LIKE '%$keyword%' OR network_operators.country LIKE '%$keyword%' OR staffcreate.name LIKE '%$keyword%' OR staffmodify.name LIKE '%$keyword%' OR clients.name LIKE '%$keyword%' OR sender_ids.direct_mno LIKE '%$keyword%'")
|
||||
->orderBy('sender_ids.senderid', 'ASC')
|
||||
->paginate(15);
|
||||
}
|
||||
@@ -51,6 +51,8 @@ class SenderIdController extends Controller
|
||||
|
||||
$networks = \DB::table('network_operators')->Select(\DB::raw('id, concat(name, " (", country, ")") AS network'))->orderBy('network')->get()->toArray();
|
||||
$network_arr = array_pluck($networks, 'network', 'id');
|
||||
$direct_mno_arr = ['YES' => 'YES', 'NO' => 'NO'];
|
||||
|
||||
// dd($network_arr);
|
||||
#$network_arr = array_combine($network_arr, $network_arr);
|
||||
|
||||
@@ -61,9 +63,10 @@ class SenderIdController extends Controller
|
||||
|
||||
$data = [
|
||||
'page_title' => 'Create Sender ID',
|
||||
'network_arr' => $network_arr,
|
||||
'network_arr' => [], // $network_arr,
|
||||
'status' => $status,
|
||||
'clients' => $clients,
|
||||
'direct_mno_arr' => $direct_mno_arr,
|
||||
'staffmembers' => $staffmembers
|
||||
];
|
||||
|
||||
@@ -87,7 +90,16 @@ class SenderIdController extends Controller
|
||||
$senderid_arr['created_by'] = session('current_user.id');
|
||||
$senderid_arr['last_modified_by'] = session('current_user.id');
|
||||
$senderid_arr['remarks'] = $request->remarks ?? '';
|
||||
|
||||
if ($request->direct_mno == 'NO') {
|
||||
$mno_world_wide = Models\Worldwidemno::find($request->network_id);
|
||||
// code... save in the network ops with status as non-direct ... user createOrUpdate method
|
||||
$network_ops_arr['name'] = $mno_world_wide->network;
|
||||
$network_ops_arr['country'] = $mno_world_wide->country;
|
||||
$network_ops_arr['name'] = $mno_world_wide->network;
|
||||
$network_ops_arr['direct_business'] = 'NO'; // $mno_world_wide->network;
|
||||
$result = Models\NetworkOps::updateOrCreate(['name' => $mno_world_wide->network, 'country' => $mno_world_wide->country, 'direct_business' => 'NO'], $network_ops_arr);
|
||||
}
|
||||
// dd($senderid_arr);
|
||||
|
||||
$result = Models\SenderId::create($senderid_arr);
|
||||
|
||||
@@ -169,4 +181,18 @@ class SenderIdController extends Controller
|
||||
return response()->json([ 'code' => 3, 'msg' => 'Request could not be handled at this time']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getMNOList($type){
|
||||
if ($type == 'YES') {
|
||||
$data_arr = \DB::table('network_operators')->Select(\DB::raw('id, concat(name, " (", country, ")") AS name'))->orderBy('country')->get()->toArray();
|
||||
}
|
||||
elseif ($type == 'NO') {
|
||||
$data_arr = \DB::table('mno_world_wide')->Select(\DB::raw('id, concat(network, " (", country, ")") AS name'))->orderBy('country')->get()->toArray();
|
||||
}
|
||||
else{
|
||||
return response()->json(['code' => 3, 'msg' => 'invalid request']);
|
||||
}
|
||||
return response()->json(['code' => 1, 'msg' => 'success', 'result' => $data_arr]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user