UserPoint.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. namespace app\admin\controller\ump;
  3. use app\admin\controller\AuthController;
  4. use crmeb\services\UtilService as Util;
  5. use app\admin\model\user\UserPoint AS UserPointModel;
  6. use think\facade\Route as Url;
  7. use crmeb\services\JsonService;
  8. /**
  9. * 优惠券控制器
  10. * Class StoreCategory
  11. * @package app\admin\controller\system
  12. */
  13. class UserPoint extends AuthController
  14. {
  15. /**
  16. * @return mixed
  17. */
  18. public function index()
  19. {
  20. $this->assign([
  21. // 'sum_point'=>UserBill::where(['category'=>'integral','type'=>'system_add'])->sum('number'),
  22. // 'count'=>UserBill::where(['category'=>'integral','type'=>'sign'])->group('uid')->count(),
  23. // 'song_point'=>UserBill::where(['category'=>'integral','type'=>'sign'])->group('uid')->sum('number'),
  24. 'is_layui' => true,
  25. 'year' => get_month(),
  26. ]);
  27. return $this->fetch();
  28. }
  29. /**
  30. * @return mixed
  31. */
  32. public function create()
  33. {
  34. $this->assign(['title' => '添加优惠券', 'action' => Url::buildUrl('save'), 'rules' => $this->rules()->getContent()]);
  35. return $this->fetch('public/common_form');
  36. }
  37. //异步获取积分列表
  38. public function getponitlist()
  39. {
  40. $where = Util::getMore([
  41. ['start_time', ''],
  42. ['end_time', ''],
  43. ['nickname', ''],
  44. ['page', 1],
  45. ['limit', 10],
  46. ]);
  47. return JsonService::successlayui(UserPointModel::getpointlist($where));
  48. }
  49. //导出Excel表格
  50. public function export()
  51. {
  52. $where = Util::getMore([
  53. ['start_time', ''],
  54. ['end_time', ''],
  55. ['nickname', ''],
  56. ]);
  57. UserPointModel::SaveExport($where);
  58. }
  59. //获取积分日志头部信息
  60. public function getuserpointbadgelist()
  61. {
  62. $where = Util::getMore([
  63. ['start_time', ''],
  64. ['end_time', ''],
  65. ['nickname', ''],
  66. ]);
  67. return JsonService::successful(UserPointModel::getUserpointBadgelist($where));
  68. }
  69. }