Index.php 809 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace app\api\controller\sharp;
  3. use app\api\controller\Controller;
  4. use app\api\service\sharp\Active as ActiveService;
  5. /**
  6. * 整点秒杀-秒杀首页
  7. * Class index
  8. * @package app\api\controller\sharp
  9. */
  10. class Index extends Controller
  11. {
  12. /**
  13. * 秒杀活动首页
  14. * @return array
  15. * @throws \think\db\exception\DataNotFoundException
  16. * @throws \think\db\exception\ModelNotFoundException
  17. * @throws \think\exception\DbException
  18. */
  19. public function index()
  20. {
  21. // 获取秒杀活动会场首页数据
  22. $service = new ActiveService;
  23. $data = $service->getHallIndex();
  24. if (empty($data['tabbar'])) {
  25. return $this->renderError('很抱歉,暂无秒杀活动');
  26. }
  27. return $this->renderSuccess($data);
  28. }
  29. }