Index.php 737 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\shop\controller;
  3. use app\shop\service\ShopService;
  4. use app\common\model\settings\Setting as SettingModel;
  5. /**
  6. * 后台首页控制器
  7. */
  8. class Index extends Controller
  9. {
  10. /**
  11. * 后台首页
  12. */
  13. public function index()
  14. {
  15. $service = new ShopService;
  16. return $this->renderSuccess('', ['data' => $service->getHomeData()]);
  17. }
  18. /**
  19. * 登录数据
  20. */
  21. public function base()
  22. {
  23. $config = SettingModel::getSysConfig();
  24. $settings = [
  25. 'shop_name' => $config['shop_name'],
  26. 'shop_bg_img' => $config['shop_bg_img']
  27. ];
  28. return $this->renderSuccess('', compact('settings'));
  29. }
  30. }