SpreadApply.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\adminapi\controller\v1\agent;
  12. use app\adminapi\controller\AuthController;
  13. use app\services\agent\SpreadApplyServices;
  14. use think\facade\App;
  15. class SpreadApply extends AuthController
  16. {
  17. /**
  18. * @var SpreadApplyServices
  19. */
  20. protected $services;
  21. /**
  22. * SpreadApply constructor.
  23. * @param App $app
  24. * @param SpreadApplyServices $services
  25. */
  26. public function __construct(App $app, SpreadApplyServices $services)
  27. {
  28. parent::__construct($app);
  29. $this->services = $services;
  30. }
  31. /**
  32. * 申请列表
  33. * @return mixed
  34. */
  35. public function applyList()
  36. {
  37. $where = $this->request->getMore([
  38. ['status', ''],
  39. ['keyword', ''],
  40. ]);
  41. return app('json')->success($this->services->applyList($where));
  42. }
  43. /**
  44. * 审核申请
  45. * @param $id
  46. * @param $uid
  47. * @param $status
  48. * @return mixed
  49. */
  50. public function applyExamine($id, $uid, $status)
  51. {
  52. [$refusal_reason] = $this->request->postMore([
  53. ['refusal_reason', ''],
  54. ], true);
  55. $this->services->applyExamine($id, $uid, $status, $refusal_reason);
  56. return app('json')->success($status == 1 ? '审核通过' : '拒绝成功');
  57. }
  58. /**
  59. * 删除申请
  60. * @param $id
  61. * @return mixed
  62. */
  63. public function applyDelete($id)
  64. {
  65. $this->services->applyDelete($id);
  66. return app('json')->success('删除成功');
  67. }
  68. }