agent.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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('agent', function () {
  16. /** 分销员管理 */
  17. Route::group(function () {
  18. //推销员列表
  19. Route::get('index', 'v1.agent.AgentManage/index')->option(['real_name' => '分销员列表']);
  20. //修改上级推广人
  21. Route::put('spread', 'v1.agent.AgentManage/editSpread')->option(['real_name' => '修改上级推广人']);
  22. //头部统计
  23. Route::get('statistics', 'v1.agent.AgentManage/get_badge')->option(['real_name' => '分销员列表头部统计']);
  24. //推广人列表
  25. Route::get('stair', 'v1.agent.AgentManage/get_stair_list')->option(['real_name' => '推广人列表']);
  26. //统计推广订单列表
  27. Route::get('stair/order', 'v1.agent.AgentManage/get_stair_order_list')->option(['real_name' => '推广订单列表']);
  28. //清除上级推广人
  29. Route::put('stair/delete_spread/:uid', 'v1.agent.AgentManage/delete_spread')->option(['real_name' => '清除上级推广人']);
  30. //取消推广资格
  31. Route::put('stair/delete_system_spread/:uid', 'v1.agent.AgentManage/delete_system_spread')->option(['real_name' => '取消推广资格']);
  32. //查看公众号推广二维码
  33. Route::get('look_code', 'v1.agent.AgentManage/look_code')->option(['real_name' => '查看公众号推广二维码']);
  34. //查看小程序推广二维码
  35. Route::get('look_xcx_code', 'v1.agent.AgentManage/look_xcx_code')->option(['real_name' => '查看小程序推广二维码']);
  36. //查看H5推广二维码
  37. Route::get('look_h5_code', 'v1.agent.AgentManage/look_h5_code')->option(['real_name' => '查看H5推广二维码']);
  38. })->option(['parent' => 'agent', 'cate_name' => '分销员管理']);
  39. /** 分销设置 */
  40. Route::group(function () {
  41. //分销配置编辑表单
  42. Route::get('config/edit_basics', 'v1.setting.SystemConfig/edit_basics')->option(['real_name' => '积分配置编辑表单']);
  43. //分销配置保存数据
  44. Route::post('config/save_basics', 'v1.setting.SystemConfig/save_basics')->option(['real_name' => '积分配置保存数据']);
  45. })->option(['parent' => 'agent', 'cate_name' => '分销设置']);
  46. /** 分销等级 */
  47. Route::group(function () {
  48. //分销员等级资源路由
  49. Route::resource('level', 'v1.agent.AgentLevel')->except(['read'])->name('AgentLevel')->option([
  50. 'real_name' => [
  51. 'index' => '获取分销员等级列表',
  52. 'create' => '获取分销员等级表单',
  53. 'save' => '保存分销员等级',
  54. 'edit' => '获取修改分销员等级表单',
  55. 'update' => '修改分销员等级',
  56. 'delete' => '删除分销员等级'
  57. ]
  58. ]);
  59. //修改分销等级状态
  60. Route::put('level/set_status/:id/:status', 'v1.agent.AgentLevel/set_status')->name('levelSetStatus')->option(['real_name' => '修改分销等级状态']);
  61. //分销员等级任务资源路由
  62. Route::resource('level_task', 'v1.agent.AgentLevelTask')->except(['read'])->option([
  63. 'real_name' => [
  64. 'index' => '获取分销员等级任务列表',
  65. 'create' => '获取分销员等级任务表单',
  66. 'save' => '保存分销员等级任务',
  67. 'edit' => '获取修改分销员等级任务表单',
  68. 'update' => '修改分销员等级任务',
  69. 'delete' => '删除分销员等级任务'
  70. ]
  71. ]);
  72. //修改分销任务状态
  73. Route::put('level_task/set_status/:id/:status', 'v1.agent.AgentLevelTask/set_status')->name('levelTaskSetStatus')->option(['real_name' => '修改分销等级任务状态']);
  74. //获取赠送分销等级表单
  75. Route::get('get_level_form', 'v1.agent.AgentManage/getLevelForm')->name('getLevelForm')->option(['real_name' => '获取赠送分销等级表单']);
  76. //赠送分销等级
  77. Route::post('give_level', 'v1.agent.AgentManage/giveAgentLevel')->name('giveAgentLevel')->option(['real_name' => '赠送分销等级']);
  78. })->option(['parent' => 'agent', 'cate_name' => '分销等级']);
  79. /** 事业部 */
  80. Route::group(function () {
  81. Route::get('division/list', 'v1.agent.Division/divisionList')->name('divisionList')->option(['real_name' => '事业部列表']);//事业部/代理商/员工列表
  82. Route::get('division/down_list', 'v1.agent.Division/divisionDownList')->name('divisionDownList')->option(['real_name' => '下级列表']);//下级列表
  83. Route::get('division/create/:uid', 'v1.agent.Division/divisionCreate')->name('divisionCreate')->option(['real_name' => '添加事业部']);//添加事业部
  84. Route::post('division/save', 'v1.agent.Division/divisionSave')->name('divisionSave')->option(['real_name' => '事业部保存']);//事业部保存
  85. Route::get('division/agent/create/:uid', 'v1.agent.Division/divisionAgentCreate')->name('divisionAgentCreate')->option(['real_name' => '添加事业部']);//添加代理商
  86. Route::post('division/agent/save', 'v1.agent.Division/divisionAgentSave')->name('divisionAgentSave')->option(['real_name' => '事业部保存']);//代理商保存
  87. Route::put('division/set_status/:status/:uid', 'v1.agent.Division/setDivisionStatus')->name('setDivisionStatus')->option(['real_name' => '状态切换']);//状态切换
  88. Route::delete('division/del/:type/:uid', 'v1.agent.Division/delDivision')->name('delDivision')->option(['real_name' => '删除代理商']);//状态切换
  89. Route::get('division/agent_apply/list', 'v1.agent.Division/AdminApplyList')->name('AdminApplyList')->option(['real_name' => '代理商申请列表']);//代理商申请列表
  90. Route::get('division/examine_apply/:id/:type', 'v1.agent.Division/examineApply')->name('examineApply')->option(['real_name' => '审核表单']);//审核表单
  91. Route::post('division/apply_agent/save', 'v1.agent.Division/applyAgentSave')->name('applyAgentSave')->option(['real_name' => '提交审核']);//提交审核
  92. Route::delete('division/del_apply/:id', 'v1.agent.Division/delApply')->name('delApply')->option(['real_name' => '删除审核']);//删除审核
  93. })->option(['parent' => 'agent', 'cate_name' => '事业部']);
  94. })->middleware([
  95. \app\http\middleware\AllowOriginMiddleware::class,
  96. \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
  97. \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
  98. \app\adminapi\middleware\AdminLogMiddleware::class
  99. ])->option(['mark' => 'agent', 'mark_name' => '分销模块']);