IndexController.php 734 B

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