|
|
|
@ -25,10 +25,68 @@ class StoreFrontAPIController extends RestController
|
|
|
|
|
$this->load->model("Items");
|
|
|
|
|
$this->load->model("BranchItemLedger");
|
|
|
|
|
|
|
|
|
|
$row = $this->Items->getItemByModelNo('DB-422');
|
|
|
|
|
// testing mode
|
|
|
|
|
//$row = $this->Items->getItemByModelNo('DB-422');
|
|
|
|
|
|
|
|
|
|
// disabled during testing
|
|
|
|
|
//$result = $this->Items->getItemByModelNo($modelno);
|
|
|
|
|
$row = $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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function itemCode_get($itemcode) {
|
|
|
|
|
|
|
|
|
|
$this->load->model("Items");
|
|
|
|
|
$this->load->model("BranchItemLedger");
|
|
|
|
|
|
|
|
|
|
//$row = $this->Items->getItemByItemcode(1093218);
|
|
|
|
|
|
|
|
|
|
// disabled during testing
|
|
|
|
|
$row = $this->Items->getItemByItemcode($itemcode);
|
|
|
|
|
|
|
|
|
|
if($row != null)
|
|
|
|
|
{
|
|
|
|
|