added fields

added fields
pull/20/head
paulcortez 5 months ago
parent bfd8571ecc
commit a5c65db6d2

@ -25,17 +25,14 @@ class StoreFrontAPIController extends RestController
$this->load->model("Items"); $this->load->model("Items");
$this->load->model("BranchItemLedger"); $this->load->model("BranchItemLedger");
$result = $this->Items->getItemInfoByModelNo('DB-422'); $row = $this->Items->getItemByModelNo('DB-422');
// disabled during testing // disabled during testing
//$result = $this->Items->getItemInfoByModelNo($modelno); //$result = $this->Items->getItemByModelNo($modelno);
$itemcount = $result->num_rows();
if($itemcount > 0) if($row != null)
{ {
$branches = []; $branches = [];
$row = $result->row();
$resultBranches = $this->BranchItemLedger->getDataByItemcodeWithBranchExcempt($row->itemcode); $resultBranches = $this->BranchItemLedger->getDataByItemcodeWithBranchExcempt($row->itemcode);
@ -58,20 +55,23 @@ class StoreFrontAPIController extends RestController
'grams' => $row->grams, 'grams' => $row->grams,
'cts' => $row->cts, 'cts' => $row->cts,
'srp' => $row->srp, 'srp' => $row->srp,
//'mrp' => $row->mrp,
'mrp' => '0',
'pic' => '',
'catCode' => $row->catCode, 'catCode' => $row->catCode,
'goldID' => $row->goldID, 'goldID' => $row->goldID,
'supCode' => $row->supCode, 'supCode' => $row->supCode,
'modifieddate' => $row->modifieddate, 'modifieddate' => $row->modifieddate,
'others' => '',
'remarks' => '',
'branches' => $branches 'branches' => $branches
]; ];
$data = ['status' => 'FOUND', $data = ['status' => 'FOUND',
'item_count' => $itemcount,
'data' => $item]; 'data' => $item];
} }
else else
$data = ['status' => 'NOTFOUND', $data = ['status' => 'NOTFOUND',
'item_count' => 0,
'data' => null]; 'data' => null];
$this->response($data, 200); $this->response($data, 200);

Loading…
Cancel
Save