RefundOrder.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace app\controller\admin\order;
  3. use ln\basic\BaseController;
  4. use app\common\repositories\store\order\MerchantReconciliationorderRepository;
  5. use app\common\repositories\store\order\MerchantReconciliationRepository;
  6. use app\common\repositories\system\merchant\MerchantRepository;
  7. use app\common\repositories\store\order\StoreRefundOrderRepository as repository;
  8. use think\App;
  9. class RefundOrder extends BaseController
  10. {
  11. protected $repository;
  12. public function __construct(App $app,repository $repository)
  13. {
  14. parent::__construct($app);
  15. $this->repository = $repository;
  16. }
  17. public function lst($id)
  18. {
  19. [$page,$limit] = $this->getPage();
  20. $where['reconciliation_type'] = $this->request->param('status',1);
  21. $where['date'] = $this->request->param('date');
  22. $where['mer_id'] = $id;
  23. $where['status'] = 3;
  24. return app('json')->success($this->repository->getAdminList($where,$page,$limit));
  25. }
  26. public function markForm($id)
  27. {
  28. if(!$this->repository->getWhereCount([$this->repository->getPk() => $id]))
  29. return app('json')->fail('数据不存在');
  30. return app('json')->success(formToData($this->repository->adminMarkForm($id)));
  31. }
  32. public function mark($id)
  33. {
  34. if(!$this->repository->getWhereCount([$this->repository->getPk() => $id]))
  35. return app('json')->fail('数据不存在');
  36. $data = $this->request->params(['admin_mark']);
  37. $this->repository->update($id,$data);
  38. return app('json')->success('备注成功');
  39. }
  40. public function getAllList()
  41. {
  42. [$page,$limit] = $this->getPage();
  43. $where = $this->request->params(['refund_order_sn','status','refund_type','date','mer_id','order_sn','is_trader']);
  44. return app('json')->success($this->repository->getAllList($where, $page, $limit));
  45. }
  46. public function reList($id)
  47. {
  48. [$page,$limit] = $this->getPage();
  49. $where = ['reconciliation_id' => $id,'type' => 1];
  50. return app('json')->success($this->repository->reconList($where,$page,$limit));
  51. }
  52. }