修改重复插入问题 增加唯一索引 记录重复插入异常

master
tpingzhang 5 years ago
parent fe145403c0
commit 8dc190dbb2

@ -1196,8 +1196,13 @@ class UserController extends BaseController
$data['create_time'] = time();
$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);
}

Loading…
Cancel
Save