user.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. use think\facade\Route;
  12. /**
  13. * 用户模块 相关路由
  14. */
  15. Route::group('user', function () {
  16. /** 用户 */
  17. Route::group(function () {
  18. //用户管理资源路由
  19. Route::resource('user', 'v1.user.User')->option([
  20. 'real_name' => [
  21. 'index' => '获取用户列表',
  22. 'create' => '获取用户表单',
  23. 'save' => '保存用户',
  24. 'read' => '获取用户详情',
  25. 'edit' => '获取修改用户表单',
  26. 'update' => '修改用户',
  27. 'delete' => '删除用户'
  28. ]
  29. ]);
  30. //添加用户保存
  31. Route::post('user/save', 'v1.user.User/save_info')->option(['real_name' => '添加用户']);
  32. //同步微信用户
  33. Route::get('user/syncUsers', 'v1.user.User/syncWechatUsers')->option(['real_name' => '同步微信用户']);
  34. //用户信息
  35. Route::get('user/user_save_info/:uid', 'v1.user.User/userSaveInfo')->option(['real_name' => '添加编辑用户信息时候的信息']);
  36. //赠送会员等级
  37. Route::get('give_level/:id', 'v1.user.User/give_level')->option(['real_name' => '赠送用户等级']);
  38. //执行赠送会员等级
  39. Route::put('save_give_level/:id', 'v1.user.User/save_give_level')->option(['real_name' => '执行赠送用户等级']);
  40. //赠送付费会员时长
  41. Route::get('give_level_time/:id', 'v1.user.User/give_level_time')->option(['real_name' => '赠送付费会员时长']);
  42. //执行赠送付费会员时长
  43. Route::put('save_give_level_time/:id', 'v1.user.User/save_give_level_time')->option(['real_name' => '执行赠送付费会员时长']);
  44. //清除会员等级
  45. Route::delete('del_level/:id', 'v1.user.User/del_level')->option(['real_name' => '清除用户等级']);
  46. //编辑其他
  47. Route::get('edit_other/:id', 'v1.user.User/edit_other')->option(['real_name' => '修改积分余额表单']);
  48. //编辑其他
  49. Route::put('update_other/:id', 'v1.user.User/update_other')->option(['real_name' => '修改积分余额']);
  50. //修改用户状态
  51. Route::put('set_status/:status/:id', 'v1.user.User/set_status')->option(['real_name' => '修改用户状态']);
  52. //获取指定用户的信息
  53. Route::get('one_info/:id', 'v1.user.User/oneUserInfo')->option(['real_name' => '获取指定用户的信息']);
  54. //设置会员分组
  55. Route::post('set_group', 'v1.user.User/set_group')->option(['real_name' => '用户分组表单']);
  56. //执行设置会员分组
  57. Route::put('save_set_group', 'v1.user.User/save_set_group')->option(['real_name' => '设置用户分组']);
  58. //设置会员标签
  59. Route::post('set_label', 'v1.user.User/set_label')->option(['real_name' => '设置用户标签']);
  60. })->option(['parent' => 'user', 'cate_name' => '用户']);
  61. /** 用户等级 */
  62. Route::group(function () {
  63. //获取添加会员等级表单
  64. Route::get('user_level/create', 'v1.user.UserLevel/create')->option(['real_name' => '添加用户等级表单']);
  65. //添加或修改会员等级
  66. Route::post('user_level', 'v1.user.UserLevel/save')->option(['real_name' => '添加或修改用户等级']);
  67. //等级详情
  68. Route::get('user_level/read/:id', 'v1.user.UserLevel/read')->option(['real_name' => '用户等级详情']);
  69. //获取系统设置的vip列表
  70. Route::get('user_level/vip_list', 'v1.user.UserLevel/get_system_vip_list')->option(['real_name' => '获取系统设置的用户等级列表']);
  71. //删除会员等级
  72. Route::put('user_level/delete/:id', 'v1.user.UserLevel/delete')->option(['real_name' => '删除用户等级']);
  73. //设置单个商品上架|下架
  74. Route::put('user_level/set_show/:id/:is_show', 'v1.user.UserLevel/set_show')->option(['real_name' => '设置用户等级上下架']);
  75. //等级列表快速编辑
  76. Route::put('user_level/set_value/:id', 'v1.user.UserLevel/set_value')->option(['real_name' => '用户等级列表快速编辑']);
  77. //等级任务列表
  78. Route::get('user_level/task/:level_id', 'v1.user.UserLevel/get_task_list')->option(['real_name' => '用户等级任务列表']);
  79. //快速编辑等级任务
  80. Route::put('user_level/set_task/:id', 'v1.user.UserLevel/set_task_value')->option(['real_name' => '快速编辑用户等级任务']);
  81. //设置等级任务显示|隐藏
  82. Route::put('user_level/set_task_show/:id/:is_show', 'v1.user.UserLevel/set_task_show')->option(['real_name' => '设置用户等级任务显示|隐藏']);
  83. //设置是否务必达成
  84. Route::put('user_level/set_task_must/:id/:is_must', 'v1.user.UserLevel/set_task_must')->option(['real_name' => '设置用户等级任务是否务必达成']);
  85. //添加等级任务表单
  86. Route::get('user_level/create_task', 'v1.user.UserLevel/create_task')->option(['real_name' => '添加用户等级任务表单']);
  87. //保存或者修改任务
  88. Route::post('user_level/save_task', 'v1.user.UserLevel/save_task')->option(['real_name' => '保存或修改用户等级任务']);
  89. //删除任务
  90. Route::delete('user_level/delete_task/:id', 'v1.user.UserLevel/delete_task')->option(['real_name' => '删除用户等级任务']);
  91. })->option(['parent' => 'user', 'cate_name' => '用户等级']);
  92. /** 用户分组 */
  93. Route::group(function () {
  94. //获取用户分组列表
  95. Route::get('user_group/list', 'v1.user.UserGroup/index')->option(['real_name' => '获取用户分组列表']);
  96. //添加修改分组表单
  97. Route::get('user_group/add/:id', 'v1.user.UserGroup/add')->option(['real_name' => '添加修改分组表单']);
  98. //保存分组表单数据
  99. Route::post('user_group/save', 'v1.user.UserGroup/save')->option(['real_name' => '保存分组表单数据']);
  100. //删除分组数据
  101. Route::delete('user_group/del/:id', 'v1.user.UserGroup/delete')->option(['real_name' => '删除用户分组数据']);
  102. })->option(['parent' => 'user', 'cate_name' => '用户分组']);
  103. /** 用户标签 */
  104. Route::group(function () {
  105. //会员标签列表
  106. Route::get('user_label', 'v1.user.UserLabel/index')->option(['real_name' => '用户标签列表']);
  107. //会员标签添加修改表单
  108. Route::get('user_label/add/:id', 'v1.user.UserLabel/add')->option(['real_name' => '添加或修改用户标签表单']);
  109. //保存标签表单数据
  110. Route::post('user_label/save', 'v1.user.UserLabel/save')->option(['real_name' => '添加或修改用户标签']);
  111. //删除会员标签
  112. Route::delete('user_label/del/:id', 'v1.user.UserLabel/delete')->option(['real_name' => '删除用户标签']);
  113. //获取用户标签
  114. Route::get('label/:uid', 'v1.user.UserLabel/getUserLabel')->option(['real_name' => '获取用户标签']);
  115. //设置和取消用户标签
  116. Route::post('label/:uid', 'v1.user.UserLabel/setUserLabel')->option(['real_name' => '设置和取消用户标签']);
  117. //设置会员分组
  118. Route::put('save_set_label', 'v1.user.user/save_set_label')->option(['real_name' => '保存用户标签']);
  119. //标签分类
  120. Route::resource('user_label_cate', 'v1.user.UserLabelCate')->except(['read'])->option([
  121. 'real_name' => [
  122. 'index' => '获取标签分类',
  123. 'create' => '获取标签分类表单',
  124. 'save' => '保存标签分类',
  125. 'edit' => '获取修改标签分类表单',
  126. 'update' => '修改标签分类',
  127. 'delete' => '删除标签分类'
  128. ]
  129. ]);
  130. Route::get('user_label_cate/all', 'v1.user.UserLabelCate/getAll')->option(['real_name' => '获取用户标签分类全部']);
  131. //用户标签(分类)树形列表
  132. Route::get('user_tree_label', 'v1.user.UserLabel/tree_list')->option(['real_name' => '用户标签(分类)树形列表']);
  133. })->option(['parent' => 'user', 'cate_name' => '用户标签']);
  134. /** 付费会员 */
  135. Route::group(function () {
  136. //会员卡批次列表资源
  137. Route::get('member_batch/index', 'v1.user.member.MemberCardBatch/index')->option(['real_name' => '会员卡批次列表']);
  138. //添加会员卡批次
  139. Route::post('member_batch/save/:id', 'v1.user.member.MemberCardBatch/save')->option(['real_name' => '添加会员卡批次']);
  140. //会员卡列表
  141. Route::get('member_card/index/:card_batch_id', 'v1.user.member.MemberCard/index')->option(['real_name' => '会员卡列表']);
  142. //会员卡修改状态
  143. Route::get('member_card/set_status', 'v1.user.member.MemberCard/set_status')->option(['real_name' => '会员卡修改状态']);
  144. //列表单字段修改操作
  145. Route::get('member_batch/set_value/:id', 'v1.user.member.MemberCardBatch/set_value')->option(['real_name' => '会员卡批次快速修改']);
  146. //会员类型
  147. Route::get('member/ship', 'v1.user.member.MemberCard/member_ship')->option(['real_name' => '会员类型列表']);
  148. //会员类型删除
  149. Route::delete('member_ship/delete/:id', 'v1.user.member.MemberCard/delete')->option(['real_name' => '会员类型删除']);
  150. //会员类型修改状态
  151. Route::get('member_ship/set_ship_status', 'v1.user.member.MemberCard/set_ship_status')->option(['real_name' => '会员类型修改状态']);
  152. //会员卡类型编辑
  153. Route::post('member_ship/save/:id', 'v1.user.member.MemberCard/ship_save')->option(['real_name' => '会员卡类型编辑']);
  154. //兑换会员卡二维码
  155. Route::get('member_scan', 'v1.user.member.MemberCardBatch/member_scan')->option(['real_name' => '兑换会员卡二维码']);
  156. //会员记录
  157. Route::get('member/record', 'v1.user.member.MemberCard/member_record')->option(['real_name' => '会员记录']);
  158. //会员权益
  159. Route::get('member/right', 'v1.user.member.MemberCard/member_right')->option(['real_name' => '会员权益列表']);
  160. //会员权益修改
  161. Route::post('member_right/save/:id', 'v1.user.member.MemberCard/right_save')->option(['real_name' => '会员权益修改']);
  162. //会员协议
  163. Route::post('member_agreement/save/:id', 'v1.user.member.MemberCardBatch/save_member_agreement')->option(['real_name' => '会员协议']);
  164. //获取会员协议
  165. Route::get('member/agreement', 'v1.user.member.MemberCardBatch/getAgreement')->option(['real_name' => '获取会员协议']);
  166. })->option(['parent' => 'user', 'cate_name' => '付费会员']);
  167. /** 用户注销 */
  168. Route::group(function () {
  169. Route::get('cancel_list', 'v1.user.UserCancel/getCancelList')->option(['real_name' => '用户注销列表']);
  170. Route::post('cancel/set_mark', 'v1.user.UserCancel/setMark')->option(['real_name' => '注销列表备注']);
  171. Route::get('cancel/agree/:id', 'v1.user.UserCancel/agreeCancel')->option(['real_name' => '同意注销']);
  172. Route::get('cancel/refuse/:id', 'v1.user.UserCancel/refuseCancel')->option(['real_name' => '拒绝注销']);
  173. })->option(['parent' => 'user', 'cate_name' => '用户注销']);
  174. })->middleware([
  175. \app\http\middleware\AllowOriginMiddleware::class,
  176. \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
  177. \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
  178. \app\adminapi\middleware\AdminLogMiddleware::class
  179. ])->option(['mark' => 'user', 'mark_name' => '用户管理']);