备份
$gameid = $this->input->post('gameid');
$id = $this->input->post('id');
$query = $this->db->select('cmd,req,rsp')->where(array('gameid'=>$gameid,'interface_id'=>$id))->order_by("id", "desc")->get('idipprotoshine');
$cmd = $this->db->where(array('gameid'=>$gameid))->order_by("id", "desc")->get('idipprotoshine')->row('cmd');
if($cmd){
if($query->num_rows()>0){
$result = $query->result_array();
echo '{cmd:"'.$result[0]['cmd'].'",req:"'.$result[0]['req'].'",rsp:"'.$result[0]['rsp'].'"';
}else{
echo '{cmd:"'.($cmd+1).'"}';
}
}else{
echo '{cmd:'.$gameid.'000}';
}