From 7e218e86e2c45231d7fe945424ed6d83e53c8422 Mon Sep 17 00:00:00 2001 From: ztt <835303992@qq.com> Date: Thu, 29 Feb 2024 20:59:16 +0800 Subject: [PATCH] 1 --- app/store/controller/Recovery.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/app/store/controller/Recovery.php b/app/store/controller/Recovery.php index f554edfa..7cda5405 100644 --- a/app/store/controller/Recovery.php +++ b/app/store/controller/Recovery.php @@ -4,8 +4,10 @@ declare (strict_types=1); namespace app\store\controller; use app\common\enum\RecoveryStatusEnum; +use app\common\model\RecoveryOrder; use app\store\model\server\RecoveryCategory; use app\store\model\server\ServerRecovery; +use cores\Request; use think\db\exception\DataNotFoundException; use think\db\exception\DbException; use think\db\exception\ModelNotFoundException; @@ -195,4 +197,27 @@ class Recovery extends Controller } return $this->renderSuccess('操作成功'); } + + /** + * 回收订单列表 + */ + public function orderList(Request $request): Json + { + $params = $request->param(); + $filter = []; + if(!empty($params['order_no'])) { + $filter[] = ['order_no', 'like', "%{$params['order_no']}%"]; + } + if (!empty($params['order_status']) && $params['order_status'] != 'all') { + $filter[] = ['order_status', '=', $params['order_status']]; + } + + $model = new RecoveryOrder(); + $list = $model->where($filter) + ->where('store_id', $this->storeId) + ->order('create_time', 'desc') + ->paginate(10); + return $this->renderSuccess(compact('list')); + } + } \ No newline at end of file