'GET request received']; $this->response($data, 200); } public function itemModel_get($modelno) { $this->load->model("Items"); $this->load->model("BranchItemLedger"); $row = $this->Items->getItemByModelNo('DB-422'); // disabled during testing //$result = $this->Items->getItemByModelNo($modelno); if($row != null) { $branches = []; $resultBranches = $this->BranchItemLedger->getDataByItemcodeWithBranchExcempt($row->itemcode); foreach($resultBranches->result() as $rowBranches ) { $branches[] = [ 'itemcode' => $rowBranches->itemcode, 'brCode' => $rowBranches->brCode, 'endingqty' => $rowBranches->endingqty ]; } $item = [ 'itemcode' => $row->itemcode, 'modelno' => $row->modelno, 'seriescode' => $row->seriescode, 'item_desc' => $row->item_desc, 'karat' => $row->karat, 'size' => $row->size, 'grams' => $row->grams, 'cts' => $row->cts, 'srp' => $row->srp, //'mrp' => $row->mrp, 'mrp' => '0', 'pic' => '', 'catCode' => $row->catCode, 'goldID' => $row->goldID, 'supCode' => $row->supCode, 'modifieddate' => $row->modifieddate, 'others' => '', 'remarks' => '', 'branches' => $branches ]; $data = ['status' => 'FOUND', 'data' => $item]; } else $data = ['status' => 'NOTFOUND', 'data' => null]; $this->response($data, 200); } }