add: getDaftarAttachment api for purchase order asset
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user