Address.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. namespace app\admin\controller\user;
  3. use app\admin\controller\BaseController;
  4. use app\admin\server\user\UsersServer;
  5. use app\api\server\user\CityServer;
  6. use support\Request;
  7. /**
  8. * 省市区
  9. * Class Users
  10. * @package app\admin\controller\user
  11. */
  12. class Address extends BaseController
  13. {
  14. /**
  15. * Notes:获取省市区县
  16. * @return \support\Response
  17. * User: QJF
  18. * Date: 2022/9/15
  19. */
  20. public function getCityList()
  21. {
  22. $city_id = $this->request->post('city_id');
  23. $result = CityServer::getCityList($city_id);
  24. return json_success($result, '成功');
  25. }
  26. /**
  27. * Notes:获取用户信息
  28. * @return \support\Response
  29. * User: yym
  30. * Date: 2022/7/26
  31. */
  32. public function getUserInfo()
  33. {
  34. $user_id = $this->request->get('user_id');
  35. $this->validateCheck('user\UserValidate', ['user_id' => $user_id], 'info');
  36. return json_success(UsersServer::getUserInfo($user_id), '成功');
  37. }
  38. /**
  39. * Notes:会员列表
  40. * @return \support\Response
  41. * User: yym
  42. * Date: 2022/8/4
  43. */
  44. public function getUserList()
  45. {
  46. $keywords = (string)$this->request->get('keywords', '');//搜索内容
  47. $category = (int)$this->request->get('category', '');//会员类型
  48. $status = (int)$this->request->get('status', '');//会员状态
  49. [$page, $limit] = $this->getPage();
  50. return json_success(UsersServer::getUserList($keywords, $category, $status, $page, $limit), '获取成功');
  51. }
  52. /**
  53. * Notes:会员认证审核
  54. * @return \support\Response
  55. * User: yym
  56. * Date: 2022/8/4
  57. */
  58. public function authUser()
  59. {
  60. $user_id = $this->request->post('user_id');//会员编号
  61. $status = $this->request->post('status');//审核状态 0=待审核 1=审核通过 2=审核驳回 3=主动撤销
  62. $content = $this->request->post('content', '');//审核意见
  63. $category = $this->request->post('category');//分类 实名认证、会员升级
  64. $admin_id = $this->request->admin_id;
  65. $this->validateCheck('user\UserValidate', ['user_id' => $user_id, 'status' => $status, 'content' => $content, 'category' => $category], 'auth');
  66. UsersServer::authUser($admin_id, $user_id, $status, $content, $category);
  67. return json_success([], '操作成功');
  68. }
  69. /**
  70. * Notes:获取会员体检信息
  71. * @return \support\Response
  72. * @throws \Exception
  73. * User: yym
  74. * Date: 2022/9/21
  75. */
  76. public function getUserReport()
  77. {
  78. $user_id = $this->request->get('user_id');//会员编号
  79. $this->validateCheck('user\UserValidate', ['user_id' => $user_id], 'report');
  80. return json_success(UsersServer::getUserReport($user_id), '获取成功');
  81. }
  82. }