35 lines
824 B
PHP
35 lines
824 B
PHP
<?php
|
|
class Staff extends MY_Controller
|
|
{
|
|
var $db_onedev;
|
|
public function index()
|
|
{
|
|
echo "Staff API";
|
|
}
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->db_onedev = $this->load->database("onedev", true);
|
|
}
|
|
|
|
public function getStaff($sexID)
|
|
{
|
|
$prm = $this->sys_input;
|
|
|
|
$sql = "SELECT m_staff.*
|
|
FROM m_staff
|
|
WHERE M_StaffIsActive = 'Y'
|
|
AND M_StaffM_SexID = ?";
|
|
$qry = $this->db_onedev->query($sql, [$sexID]);
|
|
if (!$qry) {
|
|
$this->db_onedev->trans_rollback();
|
|
$this->sys_error_db("slect staff error", $this->db_onedev);
|
|
exit;
|
|
}
|
|
$rows = $qry->result_array();
|
|
|
|
echo json_encode($rows);
|
|
}
|
|
}
|