BroadcastRoom.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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\api\store\broadcast;
  12. use app\common\repositories\store\broadcast\BroadcastRoomRepository;
  13. use crmeb\basic\BaseController;
  14. use think\App;
  15. class BroadcastRoom extends BaseController
  16. {
  17. /**
  18. * @var BroadcastRoomRepository
  19. */
  20. protected $repository;
  21. public function __construct(App $app, BroadcastRoomRepository $repository)
  22. {
  23. parent::__construct($app);
  24. $this->repository = $repository;
  25. }
  26. /**
  27. * 直播间列表
  28. * @return \think\response\Json
  29. * @author wuhaotian
  30. * @email 442384644@qq.com
  31. * @date 2024/7/10
  32. */
  33. public function lst()
  34. {
  35. [$page, $limit] = $this->getPage();
  36. return app('json')->success($this->repository->userList([], $page, $limit));
  37. }
  38. /**
  39. * 热门直播间
  40. * @return \think\response\Json
  41. * @author wuhaotian
  42. * @email 442384644@qq.com
  43. * @date 2024/7/10
  44. */
  45. public function hot()
  46. {
  47. [$page, $limit] = $this->getPage();
  48. $where = ['hot' => 1];
  49. $where['mer_id'] = $this->request->param('mer_id');
  50. return app('json')->success($this->repository->userList($where, $page, $limit));
  51. }
  52. }