StoreProductGroupBuying.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\controller\admin\store;
  12. use app\common\repositories\store\product\ProductGroupBuyingRepository;
  13. use app\common\repositories\store\product\ProductGroupUserRepository;
  14. use crmeb\basic\BaseController;
  15. use think\App;
  16. /**
  17. * 拼团活动
  18. */
  19. class StoreProductGroupBuying extends BaseController
  20. {
  21. protected $repository;
  22. /**
  23. * Product constructor.
  24. * @param App $app
  25. * @param ProductGroupBuyingRepository $repository
  26. */
  27. public function __construct(App $app, ProductGroupBuyingRepository $repository)
  28. {
  29. parent::__construct($app);
  30. $this->repository = $repository;
  31. }
  32. /**
  33. * 团列表
  34. * @return \think\response\Json
  35. * @author Qinii
  36. * @day 1/12/21
  37. */
  38. public function lst()
  39. {
  40. [$page, $limit] = $this->getPage();
  41. $where = $this->request->params(['keyword', 'status', 'date', 'mer_id', 'is_trader', 'user_name']);
  42. $data = $this->repository->getAdminList($where, $page, $limit);
  43. return app('json')->success($data);
  44. }
  45. /**
  46. * 团成员列表
  47. * @param $id
  48. * @return \think\response\Json
  49. * @author Qinii
  50. * @day 1/12/21
  51. */
  52. public function detail($id)
  53. {
  54. [$page, $limit] = $this->getPage();
  55. if (!$this->repository->get($id))
  56. return app('json')->fail('数据不存在');
  57. $where = ['group_buying_id' => $id];
  58. $list = app()->make(ProductGroupUserRepository::class)->getAdminList($where, $page, $limit);
  59. return app('json')->success($list);
  60. }
  61. }