Pointshop.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 Pointshop extends BasePointShop
  17. {
  18. public function initialize()
  19. {
  20. parent::initialize(); // TODO: Change the autogenerated stub
  21. Lang::load(base_path().'home/lang/'.config('lang.default_lang').'/pointprod.lang.php');
  22. Lang::load(base_path().'home/lang/'.config('lang.default_lang').'/voucher.lang.php');
  23. }
  24. public function index(){
  25. //查询会员及其附属信息
  26. parent::pointshopMInfo();
  27. //开启代金券功能后查询推荐的热门店铺代金券列表和平台代金券
  28. if (config('ds_config.voucher_allow') == 1){
  29. //热门店铺代金券
  30. $recommend_voucher = model('voucher')->getRecommendTemplate(6);
  31. View::assign('recommend_voucher',$recommend_voucher);
  32. //平台代金券
  33. $where = array();
  34. $where[]=array('mallvouchertemplate_startdate','<',TIMESTAMP);
  35. $where[]=array('mallvouchertemplate_enddate','>',TIMESTAMP);
  36. $mallvoucherlist = model('mallvouchertemplate')->getMallvouchertemplateList($where, 6);
  37. View::assign('mallvoucherlist',$mallvoucherlist);
  38. }
  39. //开启积分兑换功能后查询推荐的热门兑换商品列表
  40. if (config('ds_config.pointprod_isuse') == 1){
  41. //热门积分兑换商品
  42. $recommend_pointsprod = model('pointprod')->getRecommendPointProd(10);
  43. View::assign('recommend_pointsprod',$recommend_pointsprod);
  44. }
  45. //SEO
  46. $this->_assign_seo(model('seo')->type('point')->show());
  47. //分类导航
  48. $nav_link = array(
  49. 0=>array('title'=>lang('homepage'),'link'=>HOME_SITE_URL),
  50. 1=>array('title'=>lang('ds_pointprod'))
  51. );
  52. View::assign('nav_link_list', $nav_link);
  53. return View::fetch($this->template_dir.'pointprod');
  54. }
  55. }