RefundOrder.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 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\order;
  12. use crmeb\basic\BaseController;
  13. use app\common\repositories\store\order\MerchantReconciliationorderRepository;
  14. use app\common\repositories\store\order\MerchantReconciliationRepository;
  15. use app\common\repositories\system\merchant\MerchantRepository;
  16. use app\common\repositories\store\order\StoreRefundOrderRepository as repository;
  17. use think\App;
  18. class RefundOrder extends BaseController
  19. {
  20. protected $repository;
  21. public function __construct(App $app,repository $repository)
  22. {
  23. parent::__construct($app);
  24. $this->repository = $repository;
  25. }
  26. public function lst($id)
  27. {
  28. [$page,$limit] = $this->getPage();
  29. $where['reconciliation_type'] = $this->request->param('status',1);
  30. $where['date'] = $this->request->param('date');
  31. $where['mer_id'] = $id;
  32. $where['status'] = 3;
  33. return app('json')->success($this->repository->getAdminList($where,$page,$limit));
  34. }
  35. public function markForm($id)
  36. {
  37. if(!$this->repository->getWhereCount([$this->repository->getPk() => $id]))
  38. return app('json')->fail('数据不存在');
  39. return app('json')->success(formToData($this->repository->adminMarkForm($id)));
  40. }
  41. public function mark($id)
  42. {
  43. if(!$this->repository->getWhereCount([$this->repository->getPk() => $id]))
  44. return app('json')->fail('数据不存在');
  45. $data = $this->request->params(['admin_mark']);
  46. $this->repository->update($id,$data);
  47. return app('json')->success('备注成功');
  48. }
  49. public function getAllList()
  50. {
  51. [$page,$limit] = $this->getPage();
  52. $where = $this->request->params(['refund_order_sn','status','refund_type','date','mer_id','order_sn','is_trader']);
  53. return app('json')->success($this->repository->getAllList($where, $page, $limit));
  54. }
  55. public function reList($id)
  56. {
  57. [$page,$limit] = $this->getPage();
  58. $where = ['reconciliation_id' => $id,'type' => 1];
  59. return app('json')->success($this->repository->reconList($where,$page,$limit));
  60. }
  61. }