Pointgrade.php 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 Pointgrade 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').'/pointgrade.lang.php');
  23. if (session('is_login') != '1'){
  24. $this->error(lang('no_login'),(string)url('Login/login'));
  25. }
  26. }
  27. public function index(){
  28. //查询会员及其附属信息
  29. $result = parent::pointshopMInfo(true);
  30. $member_info = $result['member_info'];
  31. unset($result);
  32. $member_model = model('member');
  33. //获得会员升级进度
  34. $membergrade_arr = $member_model->getMemberGradeArr(true, $member_info['member_exppoints'],$member_info['level']);
  35. View::assign('membergrade_arr', $membergrade_arr);
  36. //处理经验值计算说明文字
  37. $exppoints_rule = config("ds_config.exppoints_rule")?unserialize(config("ds_config.exppoints_rule")):array();
  38. $ruleexplain_arr = array();
  39. $exppoints_rule['exp_orderrate'] = floatval($exppoints_rule['exp_orderrate']);
  40. if ($exppoints_rule['exp_orderrate'] > 0){
  41. $ruleexplain_arr['exp_order'] = lang('empirical_value_calculated_valid_shopping')."{$exppoints_rule['exp_orderrate']}". lang('ds_yuan')."=1". lang('experience');
  42. $exp_ordermax = intval($exppoints_rule['exp_ordermax']);
  43. if ($exp_ordermax > 0){
  44. $ruleexplain_arr['exp_order'] .= lang('single_order_most_available')."{$exppoints_rule['exp_ordermax']}". lang('experience');
  45. }
  46. }
  47. $exppoints_rule['exp_login'] = intval($exppoints_rule['exp_login']);
  48. if ($exppoints_rule['exp_login'] > 0){
  49. $ruleexplain_arr['exp_login'] = lang('members_first_logged_each_day')."{$exppoints_rule['exp_login']}". lang('experience');
  50. }
  51. $exppoints_rule['exp_comments'] = intval($exppoints_rule['exp_comments']);
  52. if ($exppoints_rule['exp_comments'] > 0){
  53. $ruleexplain_arr['exp_comments'] = lang('review_order_will_obtained')."{$exppoints_rule['exp_comments']}". lang('experience');
  54. }
  55. View::assign('ruleexplain_arr', $ruleexplain_arr);
  56. //分类导航
  57. $nav_link = array(
  58. 0=>array('title'=>lang('homepage'),'link'=>HOME_SITE_URL),
  59. 1=>array('title'=>lang('ds_pointprod'),'link'=>(string)url('Pointshop/index')),
  60. 2=>array('title'=> lang('my_growth'))
  61. );
  62. View::assign('nav_link_list', $nav_link);
  63. return View::fetch($this->template_dir.'pointgrade');
  64. }
  65. /**
  66. * 经验明细列表
  67. */
  68. public function exppointlog(){
  69. //查询会员及其附属信息
  70. $result = parent::pointshopMInfo();
  71. //查询积分日志列表
  72. $exppoints_model = model('exppoints');
  73. $condition = array();
  74. $condition[] = array('explog_memberid','=',session('member_id'));
  75. $list_log = $exppoints_model->getExppointslogList($condition, '*', 20, 'explog_id desc');
  76. //信息输出
  77. View::assign('stage_arr',$exppoints_model->getExppointsStage());
  78. View::assign('show_page', $exppoints_model->page_info->render());
  79. View::assign('list_log',$list_log);
  80. //分类导航
  81. $nav_link = array(
  82. 0=>array('title'=>lang('homepage'),'link'=>HOME_SITE_URL),
  83. 1=>array('title'=>lang('ds_pointprod'),'link'=>(string)url('Pointshop/index')),
  84. 2=>array('title'=> lang('experience_details'))
  85. );
  86. View::assign('nav_link_list', $nav_link);
  87. return View::fetch($this->template_dir.'point_exppointslog');
  88. }
  89. }