Files
BE_IBL/application/controllers/mockup/sampling/sampling/Queue.php
2026-04-15 15:24:12 +07:00

68 lines
1.7 KiB
PHP
Executable File

<?php
class Queue extends MY_Controller
{
function __construct()
{
parent::__construct();
$this->db_smartone = $this->load->database("onedev", true);
}
public function index()
{
echo "Queue API";
}
public function call_skip_process()
{
$prm = $this->sys_input;
$order_id = $prm['order_id'];
$station_id = $prm['station_id'];
$act = $prm['act'];
$uid = $this->sys_user['M_UserID'];
$sql = "CALL sp_sampling_que_status('{$order_id}', '{$station_id}', '{$act}', '{$uid}')";
$query = $this->db_smartone->query($sql);
if ($query)
{
$x = $query->row();
if ($x->status == "OK")
{
$this->sys_ok($x);
return;
}
$this->sys_error_db("SAMPLING QUE : " . $x->message, $this->db_smartone);
exit;
}
$this->sys_error_db("SAMPLING QUE : " . $this->db_smartone->last_query(), $this->db_smartone);
exit;
}
public function recall()
{
$prm = $this->sys_input;
$order_id = $prm['order_id'];
$station_id = $prm['station_id'];
$sql = "CALL sp_sampling_recall('{$order_id}', '{$station_id}')";
$query = $this->db_smartone->query($sql);
$this->clean_mysqli_connection($this->db_smartone->conn_id);
if ($query)
{
$row = $query->row();
if ($row->status == "OK")
{
$this->sys_ok($row);
exit;
}
}
$this->sys_error_db("Barcode ADD", $this->db_smartone);
}
}
?>