备份

$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}';
        }
posted @ 2012-06-26 10:15  holyes  阅读(113)  评论(0编辑  收藏  举报