Showjoinin.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace app\home\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. use think\facade\Db;
  6. /**
  7. *
  8. *
  9. * ----------------------------------------------------------------------------
  10. *
  11. * 控制器
  12. */
  13. class Showjoinin extends BaseMall
  14. {
  15. public function initialize()
  16. {
  17. parent::initialize();
  18. Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/showjoinin.lang.php');
  19. }
  20. /*
  21. * 入驻相关首页介绍
  22. */
  23. public function index()
  24. {
  25. $code_info = config('ds_config.store_joinin_pic');
  26. $info['pic'] = array();
  27. $info['show_txt'] = '';
  28. if (!empty($code_info)) {
  29. $info = unserialize($code_info);
  30. }
  31. $storejoinin_model = model('storejoinin');
  32. $joinin_detail = $storejoinin_model->getOneStorejoinin(array('member_id' => session('member_id')));
  33. View::assign('joinin_detail', $joinin_detail); //入驻信息
  34. View::assign('pic_list', $info['pic']); //首页图片
  35. View::assign('show_txt', $info['show_txt']); //贴心提示
  36. $help_model = model('help');
  37. $condition = array();
  38. $condition[] = array('helptype_id', '=', 1); //入驻指南
  39. $help_list = $help_model->getHelpList($condition, '', 4); //显示4个
  40. //获取第一文章分类的前三篇文章
  41. $index_articles = Db::name('article')->where('ac.ac_code', 'notice')->where('a.article_show', 1)->alias('a')->field('a.article_id,a.article_url,a.article_title')->order('a.article_sort asc,a.article_time desc')->limit(5)->join('articleclass ac', 'a.ac_id=ac.ac_id')->select()->toArray();
  42. View::assign('index_articles', $index_articles);
  43. View::assign('help_list', $help_list);
  44. View::assign('article_list', ''); //底部不显示文章分类
  45. View::assign('show_sign', 'joinin');
  46. View::assign('html_title', config('ds_config.site_name') . ' - ' . lang('tenants'));
  47. return View::fetch($this->template_dir . 'index');
  48. }
  49. }