UserIntegral.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace app\controller\merchant\user;
  3. use app\common\repositories\store\coupon\StoreCouponUserRepository;
  4. use app\common\repositories\store\order\StoreOrderRepository;
  5. use app\common\repositories\user\UserBillRepository;
  6. use app\common\repositories\user\UserLabelRepository;
  7. use app\common\repositories\user\UserMerchantRepository;
  8. use ln\basic\BaseController;
  9. use FormBuilder\Exception\FormBuilderException;
  10. use think\App;
  11. use think\db\exception\DataNotFoundException;
  12. use think\db\exception\DbException;
  13. use think\db\exception\ModelNotFoundException;
  14. /**
  15. * Class UserMerchant
  16. * @package app\controller\merchant\user
  17. * @author zfy
  18. * @day 2020/10/20
  19. */
  20. class UserIntegral extends BaseController
  21. {
  22. protected $repository;
  23. public function __construct(App $app, UserBillRepository $repository)
  24. {
  25. parent::__construct($app);
  26. $this->repository = $repository;
  27. }
  28. /**
  29. * TODO 积分日志
  30. * @return \think\response\Json
  31. * @author Qinii
  32. * @day 6/9/21
  33. */
  34. public function getList()
  35. {
  36. [$page, $limit] = $this->getPage();
  37. $where = $this->request->params(['keyword', 'date']);
  38. $where['category'] = 'mer_integral';
  39. $where['mer_id'] = $this->request->merId();
  40. return app('json')->success($this->repository->getList($where, $page, $limit));
  41. }
  42. /**
  43. * TODO
  44. * @return \think\response\Json
  45. * @author Qinii
  46. * @day 6/9/21
  47. */
  48. public function getTitle()
  49. {
  50. return app('json')->success($this->repository->getStat($this->request->merId()));
  51. }
  52. }