新增接口弹窗
This commit is contained in:
parent
859cbcd2f7
commit
251d97c901
@ -156,9 +156,14 @@ class UserController extends AbstractController
|
||||
/**
|
||||
* 获取弹窗数据
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function getUserPopup(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(UserRequest::class);
|
||||
$request->scene('getUserPopup')->validateResolved();
|
||||
|
||||
$UserService = new UserService();
|
||||
$data = $UserService->getUserPopup();
|
||||
return $this->response->json($data);
|
||||
|
||||
@ -16,6 +16,9 @@ class UserRequest extends FormRequest
|
||||
'putUserName' => [ // 修改用户名
|
||||
'user_name',
|
||||
],
|
||||
'getUserPopup' => [ // 获取弹窗数据
|
||||
'popup_type',
|
||||
],
|
||||
'addUserAddress' => [ // 添加用户收获地址
|
||||
'province_id',
|
||||
'city_id',
|
||||
|
||||
@ -522,6 +522,8 @@ class UserService extends BaseService
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$popup_type = $this->request->input('popup_type');
|
||||
|
||||
if (empty($user_info)){
|
||||
// 未登陆
|
||||
return success();
|
||||
@ -529,6 +531,7 @@ class UserService extends BaseService
|
||||
|
||||
$params = array();
|
||||
$params['user_id'] = $user_info['user_id'];
|
||||
$params['popup_type'] = $popup_type;
|
||||
$popup = Popup::getList($params);
|
||||
if (empty($popup)){
|
||||
return success();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user