31 lines
916 B
PHP
31 lines
916 B
PHP
<?php
|
|
|
|
class Synctablev1 extends MY_Controller
|
|
{
|
|
function __construct() {
|
|
parent::__construct();
|
|
//$this->db = $this->load->database('regional', true);
|
|
$this->db = $this->load->database('onedev', true);
|
|
}
|
|
|
|
function update() {
|
|
$md5 = $this->sys_input["md5"];
|
|
$param = $this->sys_input["param"];
|
|
$j_param = json_encode($param);
|
|
$l_md5 = md5($j_param);
|
|
if ($md5 != $l_md5 ) {
|
|
echo json_encode(array("status" => "ERR", "message" => "MD5 $md5 <> $l_md5"));
|
|
exit;
|
|
}
|
|
$table = $param["table"];
|
|
$records = $param["records"];
|
|
$id = $param["id"];
|
|
$qry = $this->db->update_batch($table,$records,$id);
|
|
if (! $qry ) {
|
|
echo json_encode( array("status" => "ERR", "message" => print_r($this->db->error(),true)));
|
|
} else {
|
|
echo json_encode( array("status" => "OK", "message" => ""));
|
|
}
|
|
}
|
|
}
|