Files
FE_CPONE/test/vuex/verification-v4/Delivery.php
2026-04-27 10:13:31 +07:00

42 lines
1.1 KiB
PHP

<?php
class Delivery extends MY_Controller
{
var $db_onedev;
public function index()
{
echo "API";
}
public function __construct()
{
parent::__construct();
$this->db_onedev = $this->load->database("onedev", true);
}
public function lookup()
{
if (! $this->isLogin) {
$this->sys_error("Invalid Token");
exit;
}
$query = " SELECT M_DeliveryID as id,
M_DeliveryTypeID as typeid,
M_DeliveryTypeCode as type,
M_DeliverySource as source,
M_DeliveryName as name
FROM
m_deliverytype
JOIN m_delivery ON M_DeliveryM_DeliveryTypeID = M_DeliveryTypeID AND M_DeliveryIsActive = 'Y'
WHERE
M_DeliveryTypeIsActive = 'Y'";
$rows = $this->db_onedev->query($query)->result_array();
$result = array(
"total" => count($rows) ,
"records" => $rows
);
$this->sys_ok($result);
exit;
}
}