Index.php 957 B

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