Common.php 917 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace app\home\controller;
  3. use think\Lang;
  4. use think\Cache;
  5. use think\Request;
  6. use think\Controller;
  7. use think\Validate;
  8. use app\admin\model\IncInfo as IncInfoModel;
  9. /**
  10. * 主页管理类
  11. */
  12. class Common extends Controller
  13. {
  14. /**
  15. * 构造函数
  16. *
  17. * @access public
  18. */
  19. public function __construct()
  20. {
  21. parent::__construct();
  22. $incData = IncInfoModel::get(1);
  23. $this->assign('incData', $incData);
  24. $location = json_decode($incData->inc_location);
  25. $this->assign('lng', $location->lng);
  26. $this->assign('lat', $location->lat);
  27. $this->assign('user_info', $this->systemLogin());
  28. }// end__construct()
  29. protected final function systemLogin()
  30. {
  31. $user_info = array(
  32. 'user_id' => session('user_id'),
  33. 'user_email' => session('user_email'),
  34. );
  35. return $user_info;
  36. }
  37. }