post()->goCheckStrict('info'); // 模拟用户数据 $userData = [ 'user_id' => $params['user_id'], 'nickname' => '测试用户', 'avatar' => 'https://example.com/avatar.jpg', 'mobile' => '138****8888', 'created_time' => date('Y-m-d H:i:s'), ]; return $this->success('获取成功', $userData); } /* * 查询会员信息 * */ public function getUserInfo(){ $params = (new UserValidate())->get()->goCheckStrict('getUserInfo'); $detail = (new UserLogic)->detail($params['mobile']); return $this->success('获取成功', $detail); } /* * 查询会员信息 * */ public function addUser(){ $params = (new UserValidate())->post()->goCheckStrict('addUser'); $result = (new UserLogic)->addUserInfo($params); if ($result) { return $this->success('新增会员成功', [],1,1); } return $this->fail(UserLogic::getError()); } /* * 更新会员信息 * */ public function updateUserInfo(){ $params = (new UserValidate())->post()->goCheckStrict('updateUserInfo'); $result = (new UserLogic)->updateUserInfo($params); if ($result) { return $this->success('编辑会员成功', [],1,1); } return $this->fail(UserLogic::getError()); } /* * 会员充值 * */ public function userRecharge(){ $params = (new UserValidate())->post()->goCheckStrict('userRecharge'); $result = (new UserLogic)->userRecharge($params); if ($result) { return $this->success('会员充值同步成功', [],1,1); } return $this->fail(UserLogic::getError()); } /** * 更新用户信息 * @return \think\response\Json */ public function update() { $params = (new UserValidate())->post()->goCheckStrict('update'); // 这里处理更新逻辑 // ... return $this->success('更新成功'); } }