fix workstation show

This commit is contained in:
mahdahar 2025-11-07 08:39:01 +07:00
parent 5138051f10
commit 687b853599
2 changed files with 3 additions and 3 deletions

View File

@ -64,7 +64,7 @@ class Workstation extends BaseController {
try { try {
$id = $input['WorkstationID']; $id = $input['WorkstationID'];
$this->model->update($id, $input); $this->model->update($id, $input);
return $this->respondCreated([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $id ], 201); return $this->respondCreated([ 'status' => 'success', 'message' => 'data updated successfully', 'data' => $this->db->getLastQuery()->getQuery() ], 201);
} catch (\Throwable $e) { } catch (\Throwable $e) {
return $this->failServerError('Something went wrong: ' . $e->getMessage()); return $this->failServerError('Something went wrong: ' . $e->getMessage());
} }

View File

@ -15,7 +15,7 @@ class WorkstationModel extends BaseModel {
protected $deletedField = 'EndDate'; protected $deletedField = 'EndDate';
public function getWorkstations() { public function getWorkstations() {
$rows = $this->select('workstation.*, department.DepartmentName, wst1.WorkstationName') $rows = $this->select('workstation.*, department.DepartmentName, wst1.WorkstationName as LinkToName')
->join('workstation wst1', 'workstation.LinkTo=wst1.WorkstationID', 'left') ->join('workstation wst1', 'workstation.LinkTo=wst1.WorkstationID', 'left')
->join('department', 'department.DepartmentID=workstation.DepartmentID', 'left') ->join('department', 'department.DepartmentID=workstation.DepartmentID', 'left')
->findAll(); ->findAll();
@ -23,7 +23,7 @@ class WorkstationModel extends BaseModel {
} }
public function getWorkstation($WorkstationID) { public function getWorkstation($WorkstationID) {
$rows = $this->select('workstation.*, department.DepartmentName, wst1.WorkstationName') $rows = $this->select('workstation.*, department.DepartmentName, wst1.WorkstationName as LinkToName')
->join('workstation wst1', 'workstation.LinkTo=wst1.WorkstationID', 'left') ->join('workstation wst1', 'workstation.LinkTo=wst1.WorkstationID', 'left')
->join('department', 'department.DepartmentID=workstation.DepartmentID', 'left') ->join('department', 'department.DepartmentID=workstation.DepartmentID', 'left')
->where('workstation.WorkstationID', $WorkstationID) ->where('workstation.WorkstationID', $WorkstationID)