UserBill.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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\admin\user;
  12. use app\common\repositories\store\ExcelRepository;
  13. use crmeb\basic\BaseController;
  14. use app\common\repositories\user\UserBillRepository;
  15. use crmeb\services\ExcelService;
  16. use think\App;
  17. class UserBill extends BaseController
  18. {
  19. protected $repository;
  20. public function __construct(App $app, UserBillRepository $repository)
  21. {
  22. parent::__construct($app);
  23. $this->repository = $repository;
  24. }
  25. public function getList()
  26. {
  27. [$page, $limit] = $this->getPage();
  28. $where = $this->request->params(['keyword', 'date', 'type']);
  29. return app('json')->success($this->repository->getList($where, $page, $limit));
  30. }
  31. public function type()
  32. {
  33. return app('json')->success($this->repository->type());
  34. }
  35. public function export()
  36. {
  37. $where = $this->request->params(['keyword', 'date', 'type']);
  38. [$page, $limit] = $this->getPage();
  39. $data = app()->make(ExcelService::class)->bill($where,$page,$limit);
  40. return app('json')->success($data);
  41. }
  42. }