Pointshop.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace app\home\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. /**
  6. * ============================================================================
  7. * DSMall多用户商城
  8. * ============================================================================
  9. * 版权所有 2014-2028 长沙德尚网络科技有限公司,并保留所有权利。
  10. * 网站地址: http://www.csdeshang.com
  11. * ----------------------------------------------------------------------------
  12. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
  13. * 不允许对程序代码以任何形式任何目的的再发布。
  14. * ============================================================================
  15. * 控制器
  16. */
  17. class Pointshop extends BasePointShop
  18. {
  19. public function initialize()
  20. {
  21. parent::initialize(); // TODO: Change the autogenerated stub
  22. Lang::load(base_path().'home/lang/'.config('lang.default_lang').'/pointprod.lang.php');
  23. Lang::load(base_path().'home/lang/'.config('lang.default_lang').'/voucher.lang.php');
  24. }
  25. public function index(){
  26. //查询会员及其附属信息
  27. parent::pointshopMInfo();
  28. //开启代金券功能后查询推荐的热门代金券列表
  29. if (config('ds_config.voucher_allow') == 1){
  30. $recommend_voucher = model('voucher')->getRecommendTemplate(6);
  31. View::assign('recommend_voucher',$recommend_voucher);
  32. }
  33. //开启积分兑换功能后查询推荐的热门兑换商品列表
  34. if (config('ds_config.pointprod_isuse') == 1){
  35. //热门积分兑换商品
  36. $recommend_pointsprod = model('pointprod')->getRecommendPointProd(10);
  37. View::assign('recommend_pointsprod',$recommend_pointsprod);
  38. }
  39. //SEO
  40. $this->_assign_seo(model('seo')->type('point')->show());
  41. //分类导航
  42. $nav_link = array(
  43. 0=>array('title'=>lang('homepage'),'link'=>HOME_SITE_URL),
  44. 1=>array('title'=>lang('ds_pointprod'))
  45. );
  46. View::assign('nav_link_list', $nav_link);
  47. return View::fetch($this->template_dir.'pointprod');
  48. }
  49. }