gamebackend/application/game/controller/UserController.php

40 lines
1.3 KiB
PHP
Raw Normal View History

2025-05-08 11:27:49 +08:00
<?php
// +----------------------------------------------------------------------
// | 作者:修缘 联系QQ278896498 QQ群1054861244
// | 声明:未经作者许可,禁止倒卖等商业运营,违者必究
// | 另接php业务网站制作、代理后台、gm后台、支付对接等
// +----------------------------------------------------------------------
// | 创建时间: 2022/1/6 23:52
// +----------------------------------------------------------------------
namespace app\game\controller;
use app\common\model\User;
use think\Request;
class UserController extends Controller
{
public function register(Request $request, User $model)
{
if ($request->isPost()) {
$param = $request->param();
try {
$inset = [
'account' => $param['email'],
'salt' => $param['salt'],
'password' => $param['password'],
'invite' => rand(100000,999999),
'register_time' => date("Y-m-d H:i:s",time())
];
$result = $model->insertGetId($inset);
} catch (\Exception $e) {
return error($e->getMessage());
}
return success('success');
}
}
}