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