From 606903c56c43ad134a19ef9ba18cdae4f2740234 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Fri, 27 Sep 2019 15:48:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=B0=83=E8=AF=95=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sdk/Controller/UserController.class.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Application/Sdk/Controller/UserController.class.php b/Application/Sdk/Controller/UserController.class.php index ebbfaa7d2..a855ee12c 100644 --- a/Application/Sdk/Controller/UserController.class.php +++ b/Application/Sdk/Controller/UserController.class.php @@ -10,6 +10,7 @@ use Com\WechatAuth; use App\Model\UserModel; use App\Model\PointShopRecordModel; use Qiniu\json_decode; +use Think\Log; class UserController extends BaseController { @@ -1186,20 +1187,15 @@ class UserController extends BaseController $data["sdk_version"] = $request["sdk_version"]; $data['play_ip'] = get_client_ip(); $data['pipuid'] = $user_data['puid']; - if ($res['id']>0) { - $user_play -> save($data); + Log::write('save_user_play_info:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($data), 'INFO'); + if ($res['id']>0) { + $user_play->save($data); $this->updateLoginRecord($data); - } else { - - - $user_play -> add($data); - + $user_play->add($data); $this->updateLoginRecord($data); - - } $this -> set_message(200, "success", "成功"); @@ -1215,7 +1211,6 @@ class UserController extends BaseController * */ private function updateLoginRecord($userPlay) { -//var_dump($userPlay);die; $map = array( 'game_id' => $userPlay['game_id'], 'user_id' => $userPlay['user_id'], @@ -1235,8 +1230,7 @@ class UserController extends BaseController 'id'=>$userLoginRecordData['id'] ); - $userLoginRecordModel->save($data); - + return $userLoginRecordModel->save($data); }