@@ -570,21 +570,21 @@ class AdministratorController extends BaseController
|
||||
// USERS (phone col: cellphone)
|
||||
$uCols = ['firstname', 'lastname', 'email', 'cellphone', 'school_id', 'city', 'state'];
|
||||
$uQB = $db->table('users')
|
||||
->select('id, firstname, lastname, email, cellphone, school_id, city, state, school_year, semester');
|
||||
->select('id, firstname, lastname, email, cellphone, school_id, city, state, semester');
|
||||
$applyMultiTokenLike($uQB, $uCols, $tokens, ['cellphone']);
|
||||
$users = $uQB->limit(150)->get()->getResultArray();
|
||||
|
||||
// STUDENTS (no phone column to search)
|
||||
$sCols = ['firstname', 'lastname', 'school_id', 'rfid_tag', 'dob', 'gender'];
|
||||
$sQB = $db->table('students')
|
||||
->select('id, parent_id, school_id, firstname, lastname, dob, gender, school_year, semester, rfid_tag');
|
||||
->select('id, parent_id, school_id, firstname, lastname, dob, gender, semester, rfid_tag');
|
||||
$applyMultiTokenLike($sQB, $sCols, $tokens, []);
|
||||
$students = $sQB->limit(150)->get()->getResultArray();
|
||||
|
||||
// PARENTS (phone col: secondparent_phone)
|
||||
$pCols = ['secondparent_firstname', 'secondparent_lastname', 'secondparent_email', 'secondparent_phone'];
|
||||
$pQB = $db->table('parents')
|
||||
->select('id, firstparent_id, secondparent_firstname, secondparent_lastname, secondparent_email, secondparent_phone, school_year, semester');
|
||||
->select('id, firstparent_id, secondparent_firstname, secondparent_lastname, secondparent_email, secondparent_phone');
|
||||
$applyMultiTokenLike($pQB, $pCols, $tokens, ['secondparent_phone']);
|
||||
foreach ($tokens as $t) {
|
||||
if (ctype_digit($t)) {
|
||||
@@ -596,14 +596,14 @@ class AdministratorController extends BaseController
|
||||
// STAFF (phone col: phone)
|
||||
$stCols = ['firstname', 'lastname', 'email', 'role_name', 'phone'];
|
||||
$stQB = $db->table('staff')
|
||||
->select('id, user_id, firstname, lastname, email, phone, role_name, school_year, active_role');
|
||||
->select('id, user_id, firstname, lastname, email, phone, role_name, active_role');
|
||||
$applyMultiTokenLike($stQB, $stCols, $tokens, ['phone']);
|
||||
$staff = $stQB->limit(150)->get()->getResultArray();
|
||||
|
||||
// EMERGENCY CONTACTS (phone col: cellphone)
|
||||
$ecCols = ['emergency_contact_name', 'relation', 'email', 'cellphone'];
|
||||
$ecQB = $db->table('emergency_contacts')
|
||||
->select('id, parent_id, emergency_contact_name, relation, cellphone, email, school_year, semester');
|
||||
->select('id, parent_id, emergency_contact_name, relation, cellphone, email');
|
||||
$applyMultiTokenLike($ecQB, $ecCols, $tokens, ['cellphone']);
|
||||
$emergency = $ecQB->limit(150)->get()->getResultArray();
|
||||
|
||||
@@ -2202,7 +2202,6 @@ class AdministratorController extends BaseController
|
||||
'cellphone' => $user['cellphone'],
|
||||
'gender' => $user['gender'],
|
||||
'created_at' => $user['created_at'],
|
||||
'school_year' => $user['school_year'],
|
||||
'paid_amount' => $paidAmount,
|
||||
'balance' => $balance,
|
||||
'students' => $students,
|
||||
|
||||
Reference in New Issue
Block a user