Link.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace app\home\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. /**
  6. * ============================================================================
  7. *
  8. * ============================================================================
  9. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  10. * 网站地址: https://www.valimart.net/
  11. * ----------------------------------------------------------------------------
  12. *
  13. * ============================================================================
  14. * 控制器
  15. */
  16. class Link extends BaseMall {
  17. public function initialize() {
  18. parent::initialize(); // TODO: Change the autogenerated stub
  19. Lang::load(base_path() . 'home/lang/'.config('lang.default_lang').'/link.lang.php');
  20. }
  21. public function index() {
  22. //把加密的用户id写入cookie
  23. $uid = input('uid');
  24. cookie('uid', $uid);
  25. //友情连接内容
  26. $link_model = model('link');
  27. $link_list = $link_model->getLinkList();
  28. /**
  29. * 整理图片链接
  30. */
  31. if (is_array($link_list)) {
  32. foreach ($link_list as $k => $v) {
  33. if (!empty($v['link_pic'])) {
  34. $link_list[$k]['link_pic'] = ds_get_pic( DIR_ADMIN . '/link' , $v['link_pic']);
  35. }
  36. }
  37. }
  38. View::assign('link_list', $link_list);
  39. View::assign('link', 'index');
  40. return View::fetch($this->template_dir . 'link');
  41. }
  42. }
  43. ?>