Memberpoints.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 Memberpoints extends BaseMember {
  17. public function initialize() {
  18. parent::initialize();
  19. Lang::load(base_path() . 'home/lang/'.config('lang.default_lang').'/memberpoints.lang.php');
  20. }
  21. /**
  22. * 积分日志列表
  23. */
  24. public function index() {
  25. $condition_arr = array();
  26. $condition_arr[]=array('pl_memberid','=',session('member_id'));
  27. if (input('param.stage')) {
  28. $condition_arr[]=array('pl_stage','=',input('param.stage'));
  29. }
  30. $saddtime = input('get.stime');
  31. $etime = input('get.etime');
  32. $if_start_time = preg_match('/^20\d{2}-\d{2}-\d{2}$/', $saddtime);
  33. $if_end_time = preg_match('/^20\d{2}-\d{2}-\d{2}$/', $etime);
  34. $start_unixtime = $if_start_time ? strtotime($saddtime) : null;
  35. $end_unixtime = $if_end_time ? strtotime($etime) : null;
  36. if ($start_unixtime) {
  37. $condition_arr[] = array('pl_addtime','>=', $start_unixtime);
  38. }
  39. if ($end_unixtime) {
  40. $end_unixtime=$end_unixtime+86399;
  41. $condition_arr[] = array('pl_addtime','<=', $end_unixtime);
  42. }
  43. $pl_desc = input('get.description');
  44. if (!empty($pl_desc)) {
  45. $condition_arr[]=array('pl_desc','like', '%' . $pl_desc . '%');
  46. }
  47. //分页
  48. //查询积分日志列表
  49. $points_model = model('points');
  50. $list_log = $points_model->getPointslogList($condition_arr, '10', '*', '');
  51. $member_points=model('member')->getMemberInfo(array('member_id'=>session('member_id')),'member_points');
  52. /* 设置买家当前菜单 */
  53. $this->setMemberCurMenu('member_points');
  54. /* 设置买家当前栏目 */
  55. $this->setMemberCurItem('points');
  56. View::assign('show_page', $points_model->page_info->render());
  57. View::assign('list_log', $list_log);
  58. View::assign('member_points', $member_points);
  59. return View::fetch($this->template_dir . 'index');
  60. }
  61. /**
  62. * 用户中心右边,小导航
  63. *
  64. * @param string $menu_type 导航类型
  65. * @param string $menu_key 当前导航的menu_key
  66. * @param array $array 附加菜单
  67. * @return
  68. */
  69. protected function getMemberItemList() {
  70. $menu_array = array(
  71. array(
  72. 'name' => 'points',
  73. 'text' => lang('ds_member_path_points'),
  74. 'url' => (string)url('Memberpoints/index')
  75. ),
  76. );
  77. return $menu_array;
  78. }
  79. }