IndexController.php 696 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Http\Controllers\Api\v1;
  3. use App\Http\Controllers\Api\webApp;
  4. use App\Services\Common\AdService;
  5. use App\Services\Common\NoticeService;
  6. /**
  7. * 测试
  8. * Class TestController
  9. * @package App\Http\Controllers\Api
  10. */
  11. class IndexController extends webApp
  12. {
  13. public function data()
  14. {
  15. $ads = AdService::make()->getListByPosition(3,1);
  16. $data = [
  17. 'banners'=> AdService::make()->getListByPosition(1),
  18. 'menus'=> AdService::make()->getListByPosition(2,2),
  19. 'notices'=> NoticeService::make()->getDataList([], 6),
  20. 'ad'=> isset($ads[0])? $ads[0] : [],
  21. ];
  22. return message(1010, true, $data);
  23. }
  24. }