StoreAdvanceController.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\api\controller\v1\activity;
  12. use app\Request;
  13. use app\services\activity\advance\StoreAdvanceServices;
  14. /**
  15. * 预售控制器
  16. * Class StoreAdvanceController
  17. * @package app\api\controller\v1\activity
  18. */
  19. class StoreAdvanceController
  20. {
  21. /**
  22. * StoreAdvanceController constructor.
  23. * @param StoreAdvanceServices $services
  24. */
  25. public function __construct(StoreAdvanceServices $services)
  26. {
  27. $this->services = $services;
  28. }
  29. /**
  30. * 预售列表
  31. * @param Request $request
  32. * @return mixed
  33. * @throws \think\db\exception\DataNotFoundException
  34. * @throws \think\db\exception\DbException
  35. * @throws \think\db\exception\ModelNotFoundException
  36. */
  37. public function index(Request $request)
  38. {
  39. $where = $request->getMore([
  40. ['time_type', 0]
  41. ]);
  42. $where['status'] = 1;
  43. $data = $this->services->getList($where);
  44. return app('json')->success($data);
  45. }
  46. /**
  47. * 预售商品详情
  48. * @param Request $request
  49. * @param $id
  50. * @return mixed
  51. * @throws \think\db\exception\DataNotFoundException
  52. * @throws \think\db\exception\DbException
  53. * @throws \think\db\exception\ModelNotFoundException
  54. */
  55. public function detail(Request $request, $id)
  56. {
  57. $data = $this->services->getAdvanceinfo($request, $id);
  58. return app('json')->success($data);
  59. }
  60. }