UserPoint.php 1.7 KB

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