新增用户弹窗接口,修改用户注册增加弹窗数据
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Services;
|
||||
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Model\Popup;
|
||||
use App\Model\SubTemplate;
|
||||
use App\Model\User;
|
||||
use App\Model\User as UserModel;
|
||||
@@ -513,6 +514,29 @@ class UserService extends BaseService
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取弹窗数据
|
||||
* @return array
|
||||
*/
|
||||
public function getUserPopup(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
if (empty($user_info)){
|
||||
// 未登陆
|
||||
return success();
|
||||
}
|
||||
|
||||
$params = array();
|
||||
$params['user_id'] = $user_info['user_id'];
|
||||
$popup = Popup::getList($params);
|
||||
if (empty($popup)){
|
||||
return success();
|
||||
}
|
||||
|
||||
return success($popup->toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过user_id获取用户openid
|
||||
* @param string|int $user_id
|
||||
@@ -591,4 +615,5 @@ class UserService extends BaseService
|
||||
|
||||
return $avatar;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user