From 29883f60ac397b704614fb87c4223b2a0d7d4795 Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Wed, 23 Oct 2019 13:42:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=87=8D=E5=A4=8D=E6=8F=92?= =?UTF-8?q?=E5=85=A5=E9=97=AE=E9=A2=98=20=20=E5=A2=9E=E5=8A=A0=E5=94=AF?= =?UTF-8?q?=E4=B8=80=E7=B4=A2=E5=BC=95=20=20=E8=AE=B0=E5=BD=95=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E6=8F=92=E5=85=A5=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Sdk/Controller/UserController.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Application/Sdk/Controller/UserController.class.php b/Application/Sdk/Controller/UserController.class.php index 16882a765..3fcb8157c 100644 --- a/Application/Sdk/Controller/UserController.class.php +++ b/Application/Sdk/Controller/UserController.class.php @@ -1196,7 +1196,13 @@ class UserController extends BaseController $data['create_ip'] = get_client_ip(); // $data['create_device_number'] = time(); - $user_play->add($data); + // 修改重复插入问题 增加唯一索引 记录重复插入异常 + try { + $user_play->add($data); + } catch (\Exception $e) { + Log::write('Duplicate Exception:' .json_encode($e->getMessage()), Log::ERR); + } + $this->updateLoginRecord($data); }