add: getDaftarAttachment api for purchase order asset
This commit is contained in:
@@ -225,6 +225,17 @@ Content-Type: application/json
|
|||||||
"status": "All"
|
"status": "All"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
// get daftar attachment
|
||||||
|
POST https://{{host}}/mockup/purchase/order/PurchaseOrderAset/getDaftarAttachment/
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"token": {{token}},
|
||||||
|
"contractID": 1,
|
||||||
|
"poID": 1
|
||||||
|
}
|
||||||
|
|
||||||
###
|
###
|
||||||
// get data kontrak po asset
|
// get data kontrak po asset
|
||||||
POST https://{{host}}/mockup/purchase/order/PurchaseOrderAset/getDataKontrakPoAset/
|
POST https://{{host}}/mockup/purchase/order/PurchaseOrderAset/getDataKontrakPoAset/
|
||||||
|
|||||||
@@ -268,6 +268,40 @@ class PurchaseOrderAset extends MY_Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDaftarAttachment() {
|
||||||
|
try {
|
||||||
|
if (!$this->isLogin) {
|
||||||
|
$this->sys_error("invalid token");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$para = $this->sys_input;
|
||||||
|
|
||||||
|
$sql = "SELECT
|
||||||
|
PurchaseOrderAssetAttachmentID AS attach_id,
|
||||||
|
PurchaseOrderAssetAttachmentName AS img_url,
|
||||||
|
PurchaseOrderAssetAttachmentCreated AS created
|
||||||
|
FROM purchase_order_asset_attachment
|
||||||
|
WHERE PurchaseOrderAssetAttachmentIsActive = 'Y'
|
||||||
|
AND PurchaseOrderAssetAttachmentContractID = ?
|
||||||
|
AND PurchaseOrderAssetAttachmentPurchaseOrderID = ?
|
||||||
|
AND PurchaseOrderAssetAttachmentType = 'order'";
|
||||||
|
$que = $this->db->query($sql, [
|
||||||
|
$para['contractID'], $para['poID']
|
||||||
|
]);
|
||||||
|
if (!$que) {
|
||||||
|
$this->sys_error_db("[Error] failed get data attachment");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
$data = $que->result_array();
|
||||||
|
|
||||||
|
$this->sys_ok($data);
|
||||||
|
} catch (Exception $exc) {
|
||||||
|
$msg = $exc->getMessage();
|
||||||
|
$this->sys_error($msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function getDataKontrakPoAset() {
|
public function getDataKontrakPoAset() {
|
||||||
try {
|
try {
|
||||||
if (!$this->isLogin) {
|
if (!$this->isLogin) {
|
||||||
|
|||||||
Reference in New Issue
Block a user