ShopApply.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. namespace app\adminapi\controller\shop\admin;
  3. use app\dict\shop\ShopApplyDict;
  4. use app\service\admin\shop\admin\ShopApplyService;
  5. use core\base\BaseAdminController;
  6. use think\Response;
  7. class ShopApply extends BaseAdminController
  8. {
  9. /**
  10. * 获取店铺申请列表
  11. * @return \think\Response
  12. */
  13. public function pages()
  14. {
  15. $data = $this->request->params([
  16. ['status', ''],
  17. ['create_time', [] ],
  18. ['category_id', ''],
  19. ['group_id', ''],
  20. ['keywords', ''],
  21. ]);
  22. return success(( new ShopApplyService() )->getPage($data));
  23. }
  24. /**
  25. * 店铺申请详情
  26. * @param int $id
  27. * @return \think\Response
  28. */
  29. public function info(int $id)
  30. {
  31. return success(( new ShopApplyService() )->getInfo($id));
  32. }
  33. /**
  34. * 店铺申请审核
  35. * @param int $id 店铺申请id
  36. * @return \think\Response
  37. */
  38. public function verify($id)
  39. {
  40. $data = $this->request->params([
  41. ['status', ''],
  42. ['refuse_reason', '']
  43. ]);
  44. $this->validate($data, 'app\validate\shop\ShopApply.verify');
  45. ( new ShopApplyService() )->verify($id, $data);
  46. return success('AUDIT_SUCCESS');
  47. }
  48. /**
  49. * 店铺申请删除
  50. * @param int $id 店铺申请id
  51. * @return Response
  52. */
  53. public function del(int $id)
  54. {
  55. ( new ShopApplyService() )->del($id);
  56. return success('DELETE_SUCCESS');
  57. }
  58. /**
  59. * 店铺申请状态
  60. * @return \think\Response
  61. */
  62. public function getStatusList()
  63. {
  64. return success(ShopApplyDict::getStatus());
  65. }
  66. }