add: getDaftarAttachment api for purchase order asset

This commit is contained in:
2026-07-09 10:34:26 +07:00
parent 7af9fb2ca4
commit 7e88cf247b
2 changed files with 45 additions and 0 deletions

View File

@@ -245,6 +245,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() {
try {
if (!$this->isLogin) {