| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace App\Http\Controllers\Api;
- use App\Helpers\Jwt;
- use App\Http\Validator\MemberValidator;
- use App\Services\Api\AdService;
- use App\Services\Api\MemberService;
- use App\Services\EmailService;
- use App\Services\RedisService;
- use App\Services\SmsService;
- /**
- * 会员控制器基类
- * Class IndexController
- * @package App\Http\Controllers
- */
- class IndexController extends webApp
- {
- /**
- * IndexController constructor.
- */
- public function __construct()
- {
- }
- /**
- * 首页数据
- * @return array
- */
- public function index(int $userId=0)
- {
- // 广告幻灯片
- $banners = [
- 'top'=> AdService::make()->getList(1, 6),
- 'middle'=> AdService::make()->getList(2, 1),
- ];
- // 交易参数
- $trade = [
- 'price'=> rand(5, 10)+(rand(10,50)/100),
- 'total'=> rand(100000,999999)+(rand(10,50)/100),
- 'count'=> rand(1000,9999),
- 'rate'=> rand(10,90)+(rand(10,50)/100),
- ];
- $notices = [];
- return message(1010, true, compact('banners','trade','notices'));
- }
- }
|