StoreController.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2017~2021 LARAVEL研发中心
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://www.laravel.cn
  8. // +----------------------------------------------------------------------
  9. // | Author: laravel开发员 <laravel.qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace App\Http\Controllers\Admin;
  12. use App\Services\Common\StoreService;
  13. /**
  14. * 商户管理-控制器
  15. * @author laravel开发员
  16. * @since 2020/11/11
  17. * @package App\Http\Controllers
  18. */
  19. class StoreController extends Backend
  20. {
  21. /**
  22. * 构造函数
  23. * @author laravel开发员
  24. * @since 2020/11/11
  25. */
  26. public function __construct()
  27. {
  28. parent::__construct();
  29. $this->service = new StoreService();
  30. }
  31. public function index()
  32. {
  33. $pageSize = request()->get('limit', 15);
  34. $params = request()->all();
  35. $params['store_id'] = $this->storeId;
  36. return $this->service->getDataList($params, $pageSize);
  37. }
  38. /**
  39. * 获取详情
  40. * @return array
  41. */
  42. public function info()
  43. {
  44. return $this->service->info();
  45. }
  46. /**
  47. * 审核商家
  48. * @return array
  49. */
  50. public function confirm()
  51. {
  52. $params = request()->post();
  53. if ($this->service->confirm($this->userId, $params)) {
  54. return message($this->service->getError(), true);
  55. } else {
  56. return message($this->service->getError(), false);
  57. }
  58. }
  59. /**
  60. * 设置状态(禁用/启用)
  61. * @return array
  62. */
  63. public function status()
  64. {
  65. $params = request()->post();
  66. if ($this->service->setStatus($params)) {
  67. return message($this->service->getError(), true);
  68. } else {
  69. return message($this->service->getError(), false);
  70. }
  71. }
  72. /**
  73. * 选项列表
  74. * @return mixed
  75. */
  76. public function options()
  77. {
  78. $result = $this->service->options();
  79. return message(1002, true, $result);
  80. }
  81. }