Pointgrade.php 4.0 KB

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