| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace App\Http\Controllers\Api\v1;
- use App\Http\Controllers\Api\webApp;
- use App\Services\Common\AdService;
- use App\Services\Common\NoticeService;
- use App\Services\ConfigService;
- /**
- * 测试
- * Class TestController
- * @package App\Http\Controllers\Api
- */
- class IndexController extends webApp
- {
- /**
- * 首页数据
- * @return array
- */
- public function data()
- {
- $ads = AdService::make()->getListByPosition(3,1);
- $data = [
- 'banners'=> AdService::make()->getListByPosition(1),
- 'menus'=> AdService::make()->getListByPosition(2,2),
- 'notices'=> NoticeService::make()->getRecommandList(6),
- 'ad'=> isset($ads[0])? $ads[0] : [],
- ];
- return message(1010, true, $data);
- }
- /**
- * 配置
- * @return array
- */
- public function config()
- {
- $data = [
- 'app_download_url'=> ConfigService::make()->getConfigByCode('app_download_url'),
- ];
- return message(1010, true, $data);
- }
- }
|