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