UserIntegral.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\controller\merchant\user;
  12. use app\common\repositories\store\coupon\StoreCouponUserRepository;
  13. use app\common\repositories\store\order\StoreOrderRepository;
  14. use app\common\repositories\user\UserBillRepository;
  15. use app\common\repositories\user\UserLabelRepository;
  16. use app\common\repositories\user\UserMerchantRepository;
  17. use crmeb\basic\BaseController;
  18. use FormBuilder\Exception\FormBuilderException;
  19. use think\App;
  20. use think\db\exception\DataNotFoundException;
  21. use think\db\exception\DbException;
  22. use think\db\exception\ModelNotFoundException;
  23. /**
  24. * Class UserMerchant
  25. * @package app\controller\merchant\user
  26. * @author xaboy
  27. * @day 2020/10/20
  28. */
  29. class UserIntegral extends BaseController
  30. {
  31. protected $repository;
  32. public function __construct(App $app, UserBillRepository $repository)
  33. {
  34. parent::__construct($app);
  35. $this->repository = $repository;
  36. }
  37. /**
  38. * TODO 积分日志
  39. * @return \think\response\Json
  40. * @author Qinii
  41. * @day 6/9/21
  42. */
  43. public function getList()
  44. {
  45. [$page, $limit] = $this->getPage();
  46. $where = $this->request->params(['keyword', 'date']);
  47. $where['category'] = 'mer_integral';
  48. $where['mer_id'] = $this->request->merId();
  49. return app('json')->success($this->repository->getList($where, $page, $limit));
  50. }
  51. /**
  52. * TODO
  53. * @return \think\response\Json
  54. * @author Qinii
  55. * @day 6/9/21
  56. */
  57. public function getTitle()
  58. {
  59. return app('json')->success($this->repository->getStat($this->request->merId()));
  60. }
  61. }