FIX_Helpdisk Reopened Issues
This commit is contained in:
parent
3b72c275c5
commit
2158bcb531
@ -59,11 +59,18 @@ class SalesExecutive extends ResourceController
|
||||
{
|
||||
try{
|
||||
$data = $this->request->getJSON(true);
|
||||
|
||||
$email = (!empty($data['email'])) ? $data['email'] : null;
|
||||
$mobile = (!empty($data['mobile'])) ? $data['mobile'] : null;
|
||||
|
||||
if ($email === null && $mobile === null) {
|
||||
return $this->respond(['status' => 'failed', 'code' => 500, 'data' => 'Email or Mobile is required'], 500);
|
||||
}
|
||||
|
||||
$insertData = [
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'mobile' => $data['mobile'],
|
||||
'email' => $email,
|
||||
'mobile' => $mobile,
|
||||
'address' => $data['address'],
|
||||
'manager_id' => $data['manager_id'],
|
||||
'created_by' => $data['created_by'],
|
||||
@ -107,11 +114,17 @@ class SalesExecutive extends ResourceController
|
||||
if (!$salesExecutive) {
|
||||
return $this->respond(['status' => 'failed', 'code' => 200, 'data' => 'Date Not Found'], 200);
|
||||
}
|
||||
$email = (!empty($data['email'])) ? $data['email'] : null;
|
||||
$mobile = (!empty($data['mobile'])) ? $data['mobile'] : null;
|
||||
|
||||
if ($email === null && $mobile === null) {
|
||||
return $this->respond(['status' => 'failed', 'code' => 500, 'data' => 'Either Email or Mobile must be provided'], 500);
|
||||
}
|
||||
|
||||
$updateData = [
|
||||
'name' => $data['name'] ?? null,
|
||||
'email' => $data['email'] ?? null,
|
||||
'mobile' => $data['mobile'] ?? null,
|
||||
'email' => $email,
|
||||
'mobile' => $mobile,
|
||||
'address' => $data['address'] ?? null,
|
||||
'updated_by' => $data['updated_by'] ?? null,
|
||||
];
|
||||
|
||||
@ -254,7 +254,7 @@ class StaffController extends ResourceController
|
||||
'mobile' => $data['mobile'] ?? null,
|
||||
'role_id' => $data['role_id'],
|
||||
'manager_id' => $data['manager_id'] ?? null,
|
||||
'handler_id' => json_encode($data['handler_id'] ?? []),
|
||||
'handler_id' => (isset($data['handler_id']) && !empty($data['handler_id'])) ? json_encode($data['handler_id']) : json_encode([]),
|
||||
'created_by' => $data['created_by']
|
||||
];
|
||||
|
||||
@ -285,18 +285,15 @@ class StaffController extends ResourceController
|
||||
return $this->respond(['status' => 'failed', 'code' => 200, 'data' => 'Date Not Found'], 200);
|
||||
}
|
||||
|
||||
|
||||
$updateData = [
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'mobile' => $data['mobile'],
|
||||
'role_id' => $data['role_id'],
|
||||
'handler_id' => !empty($data['handler_id']) ? json_encode($data['handler_id']) : [],
|
||||
'handler_id' => (isset($data['handler_id']) && !empty($data['handler_id'])) ? json_encode($data['handler_id']) : json_encode([]),
|
||||
'updated_by' => $data['updated_by'],
|
||||
];
|
||||
|
||||
|
||||
|
||||
$this->StaffModel->update($id, $updateData);
|
||||
|
||||
return $this->respond(['status' => 'success', 'code' => 200, 'data' => []], 200);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user