Information.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace App\Api\Controller;
  3. use Biz\Account\AccountManager;
  4. use App\Api\Model\AccountNews as AccountNewsModel;
  5. use App\Api\Model\Article as ArticleModel;
  6. /**
  7. * 个人中心-消息通知
  8. */
  9. class Information extends BaseController
  10. {
  11. public function init() {
  12. $this->accountManager = new AccountManager();
  13. $this->commonFunction = C()->get('commonFunction');
  14. //获取用户token
  15. $token = $_POST['token'];
  16. $UserInfo = $this->getAgent($token);
  17. //获取用户信息
  18. $this->UserInfo = $UserInfo;
  19. //获取用户uuid
  20. $this->account_identity = $UserInfo['account_identity'];
  21. }
  22. /**
  23. * 获取所有 消息通知
  24. */
  25. public function getAll(){
  26. dd( $this->UserInfo);
  27. //获取投注信息
  28. $BetNews = $this->getUserNews();
  29. }
  30. /**
  31. * 获取通知消息
  32. */
  33. public function getUserNews(){
  34. //获取当前用户投注信息
  35. $UserNews = AccountNewsModel::getUserNews($this->UserInfo);
  36. Render($UserNews, '1', lang('Tips','Sports')->get('success'));
  37. }
  38. /**
  39. * 获取系统通知
  40. */
  41. public function getArticle(){
  42. $Article = ArticleModel::getArticle($this->UserInfo);
  43. Render($Article, '1', lang('Tips','Sports')->get('success'));
  44. }
  45. /**
  46. * token获取用户详情
  47. */
  48. public function getAgent($token = '') {
  49. $checkToken = $this->accountManager->checkEffectiveTime($token);
  50. if ($checkToken['status'] != 1) {
  51. Render($checkToken['data'], $checkToken['status'], lang('commons')->get('user does login'));
  52. };
  53. $result = $this->accountManager->refreshToken($token);
  54. return $result['data'];
  55. }
  56. }
  57. ?>