36 lines
634 B
PHP
36 lines
634 B
PHP
<?php
|
|
|
|
|
|
class Helper extends MY_Controller
|
|
{
|
|
var $db_smartone;
|
|
|
|
public function index()
|
|
{
|
|
echo "RE Helper API";
|
|
}
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->db_smartone = $this->load->database("onedev", true);
|
|
}
|
|
|
|
public function calc_age()
|
|
{
|
|
$prm = $this->sys_input;
|
|
$orderID = $prm["orderID"];
|
|
|
|
$sql = "call sp_recount_age(?)";
|
|
$query = $this->db_smartone->query($sql,array($orderID));
|
|
|
|
if ($query) {
|
|
$this->sys_ok("OK");
|
|
}
|
|
else {
|
|
$this->sys_error_db("", $this->db_smartone);
|
|
exit;
|
|
}
|
|
}
|
|
}
|