public function index()
 {
     $id = intval($_GET['id']);
     $uid = get_current_userid();
     $anwser = $_GET['anwser'];
     $game = sp_sql_game($id, '');
     if ($game['anwser'] == $anwser) {
         //Ёи╧╕
         echo 'xx';
     } else {
         echo 'failer';
     }
     $userid = 111111;
     $users_model = D("Users");
     $user = $users_model->where(array("id" => $userid))->find();
     var_dump($user);
 }
 public function tip()
 {
     $gid = intval($_GET['id']);
     $uid = get_current_userid();
     if ($uid == 0) {
         $result = array('errcode' => 1, 'str' => "首先,你需要登录。。");
         echo json_encode($result);
         exit;
     }
     $game = sp_sql_game($gid, '');
     if ($game['score'] < 2) {
         $result = array('errcode' => 2, 'str' => "这么简单的题你也好意思要提示?");
     } else {
         $m_gl = M("GamesLog");
         $gl = M("GamesLog")->where("uid={$uid} and gid={$gid}")->save(array('tiped' => 1));
         $result = array('errcode' => 0, 'str' => $game['tip']);
     }
     echo json_encode($result);
 }