备份

$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}';
        }
原文地址:https://www.cnblogs.com/holyes/p/fe163b1312e69d3abbda798bf4daf8b0.html