Index.php 661 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: 中闽 < 1464674022@qq.com >
  5. * Date: 2019/12/5
  6. * Time: 17:44
  7. */
  8. namespace app\api\controller;
  9. use app\api\controller\base\Base;
  10. use app\common\model\Announcement;
  11. class Index extends Base
  12. {
  13. public function index()
  14. {
  15. $this->json_success('success', ['ip' => $this->request->ip()]);
  16. }
  17. //首页接口
  18. public function site()
  19. {
  20. $announcements = (new Announcement())->order('id desc')->limit(3)->select();
  21. return [
  22. "banners" => [],
  23. "boxs" => [],
  24. // "contact_us" => "",
  25. "announcements" => $announcements
  26. ];
  27. }
  28. }