Merge pull request 'updates api and added more fields' (#19) from paulcortezl5 into main

Reviewed-on: #19
pull/20/head
paul 5 months ago
commit bfd8571ecc

@ -23,24 +23,46 @@ class StoreFrontAPIController extends RestController
public function itemModel_get($modelno) {
$this->load->model("Items");
$result = $this->Items->getItemInfoByModelNo('GE-4558');
$this->load->model("BranchItemLedger");
$result = $this->Items->getItemInfoByModelNo('DB-422');
// disabled during testing
//$result = $this->Items->getItemInfoByModelNo($modelno);
$itemcount = $result->num_rows();
$itemcount = $result->num_rows();
if($itemcount > 0)
{
$branches = [];
$row = $result->row();
$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,
'catCode' => $row->catCode,
'goldID' => $row->goldID
'goldID' => $row->goldID,
'supCode' => $row->supCode,
'modifieddate' => $row->modifieddate,
'branches' => $branches
];
$data = ['status' => 'FOUND',

Loading…
Cancel
Save