From f0e19a43f2dd11bcb055e845c24ffd109c2daba1 Mon Sep 17 00:00:00 2001 From: "wangmingchuan321@qq.com" Date: Wed, 31 Jan 2024 19:29:33 +0800 Subject: [PATCH] 123213 --- app/api/controller/Order.php | 12 +++++++++++- app/api/model/Order.php | 14 ++++++++++++++ app/api/service/Goods.php | 2 -- app/common/model/Goods.php | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 3 deletions(-) diff --git a/app/api/controller/Order.php b/app/api/controller/Order.php index fbf11ac4..ef6323ff 100644 --- a/app/api/controller/Order.php +++ b/app/api/controller/Order.php @@ -51,7 +51,17 @@ class Order extends Controller if ($res) { return $this->renderSuccess('删除成功'); } - return $this->renderSuccess('删除失败'); + return $this->renderError('删除失败'); + } + + public function orderfast() + { + $model = new OrderModel; + $res = $model->orderfast(); + if ($res) { + return $this->renderSuccess('催单成功'); + } + return $this->renderError('催单失败'); } /** diff --git a/app/api/model/Order.php b/app/api/model/Order.php index abc6de11..9e202517 100644 --- a/app/api/model/Order.php +++ b/app/api/model/Order.php @@ -135,6 +135,7 @@ class Order extends OrderModel $info = $service->data()['storeInfo']->toArray(); //todo wmc $info['phone'] = 13770778236; + foreach ($list['data'] as &$v) { $v['storeInfo'] = $info; } @@ -156,6 +157,11 @@ class Order extends OrderModel return $res; } + public function orderfast() + {//todo wmc + return 0; + } + /** * 取消订单 * @return bool|mixed @@ -349,6 +355,14 @@ class Order extends OrderModel // 查询订单记录 $order = static::detail($where, $with); empty($order) && throwError('订单不存在'); + + //这边后面改成多商户的话需要根据storeid去获取信息 + $service = new StoreService; + $info = $service->data()['storeInfo']->toArray(); + //todo wmc + $info['phone'] = 13770778236; + + $order->storeInfo = $info; return $order; } diff --git a/app/api/service/Goods.php b/app/api/service/Goods.php index c140bcd6..bffafc63 100644 --- a/app/api/service/Goods.php +++ b/app/api/service/Goods.php @@ -108,8 +108,6 @@ class Goods extends GoodsService //大牌正品列表 public function brandList($storeid) { - - $page = (int)$_GET['page']; $model = new GoodsModel; $goodsList = $model->getList([ diff --git a/app/common/model/Goods.php b/app/common/model/Goods.php index 17e3004f..18eaa031 100644 --- a/app/common/model/Goods.php +++ b/app/common/model/Goods.php @@ -184,6 +184,38 @@ class Goods extends BaseModel $query->field(['(sales_initial + sales_actual) as goods_sales']); // 排序条件 $sort = $this->setQuerySort($param); + $order = request()->get()['order'] ?? ''; + + if (!empty($order)) { + if ($order == 1) { + $sort['goods_price_min'] = 'asc'; + } + if ($order == 2) { + $sort['goods_price_min'] = 'desc'; + } + //todo wmc + if ($order == 3) { + $sort['goods_price_min'] = 'asc'; + } + if ($order == 4) { + $sort['goods_price_min'] = 'desc'; + } + + if ($order == 5) { + $sort['goods_sales'] = 'asc'; + } + if ($order == 6) { + $sort['goods_sales'] = 'desc'; + } + //todo wmc + if ($order == 7) { + $sort['goods_sales'] = 'asc'; + } + if ($order == 8) { + $sort['goods_sales'] = 'desc'; + } + } + // 执行查询 $list = $query->with(['images.file']) ->alias($this->name)