From 1520ae6710d4e549ec963f87fe27b2a765039238 Mon Sep 17 00:00:00 2001 From: wangwei01 Date: Tue, 7 May 2019 17:49:06 +0800 Subject: [PATCH] 1 --- webapp/controller/SignController.class.php | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/webapp/controller/SignController.class.php b/webapp/controller/SignController.class.php index ce5a186..be4a3e4 100644 --- a/webapp/controller/SignController.class.php +++ b/webapp/controller/SignController.class.php @@ -40,6 +40,34 @@ class SignController{ phpcommon\sendError(ERR_USER_BASE + 1, '没有这个玩家'); return; } + $row1 = $conn->execQueryOne('SELECT * FROM user WHERE accountid=:accountid;', + array( + ':accountid' => $account_id + )); + if (!$row1) { + $ret = $conn->execScript('INSERT INTO user(accountid, rank, game_times, win_times, kills, harm, add_HP, alive_time, coin_num, integral, kill_his, alive_time_his, harm_his, add_HP_his) ' . + ' VALUES(:accountid, 0, 0, 0, 0, 0, 0, 0, 100000, 0, 0, 0, 0, 0);', + array( + ':accountid' => $account_id + )); + if (!$ret) { + die(); + return; + } + echo json_encode(array( + 'errcode' => 0, + 'errmsg' => '', + 'game_times' => 0, + 'win_times' => 0, + 'high_kill' => 0, + 'kills' => 0, + 'high_harm' => 0, + 'harm' => 0, + 'add_HP' => 0, + 'alive_time' => 0, + 'coin_num' => 100000, + )); + } $row = $conn->execQueryOne('SELECT * FROM sign WHERE accountid=:accountid;', array( ':accountid' => $account_id