StoreProductGroupBuying.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 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. class StoreProductGroupBuying extends BaseController
  17. {
  18. protected $repository;
  19. /**
  20. * Product constructor.
  21. * @param App $app
  22. * @param ProductGroupBuyingRepository $repository
  23. */
  24. public function __construct(App $app, ProductGroupBuyingRepository $repository)
  25. {
  26. parent::__construct($app);
  27. $this->repository = $repository;
  28. }
  29. /**
  30. * TODO 团列表
  31. * @return \think\response\Json
  32. * @author Qinii
  33. * @day 1/12/21
  34. */
  35. public function lst()
  36. {
  37. [$page, $limit] = $this->getPage();
  38. $where = $this->request->params(['keyword','status','date','mer_id','is_trader','user_name']);
  39. $data = $this->repository->getAdminList($where,$page,$limit);
  40. return app('json')->success($data);
  41. }
  42. /**
  43. * TODO 团成员列表
  44. * @param $id
  45. * @return \think\response\Json
  46. * @author Qinii
  47. * @day 1/12/21
  48. */
  49. public function detail($id)
  50. {
  51. [$page, $limit] = $this->getPage();
  52. if(!$this->repository->get($id))
  53. return app('json')->fail('数据不存在');
  54. $where = ['group_buying_id' => $id];
  55. $list = app()->make(ProductGroupUserRepository::class)->getAdminList($where,$page,$limit);
  56. return app('json')->success($list);
  57. }
  58. }