Pointgrade.php 4.2 KB

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