From c83342af68df45a1dead9203d8b842c074e8a381 Mon Sep 17 00:00:00 2001 From: wanghousheng Date: Fri, 22 Mar 2024 11:17:46 +0800 Subject: [PATCH] 1 --- app/api/controller/Shop.php | 22 ++++++++-------------- app/timer/service/Order.php | 9 +++++---- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/app/api/controller/Shop.php b/app/api/controller/Shop.php index a70e4409..4142952b 100644 --- a/app/api/controller/Shop.php +++ b/app/api/controller/Shop.php @@ -55,11 +55,8 @@ class Shop extends Controller return $this->renderError('缺少必要参数'); } $detail = ShopModel::detail($shopId); - // var_dump($detail['shop_hours']); - // exit; if (!empty($detail['shop_hours'])) { - $shop_hours = explode(' ', $detail['shop_hours']); - $shop_hours = explode('-', $shop_hours[1] ?? "00:00"); + $shop_hours = explode('-', $detail['shop_hours'] ?? "00:00"); if (count($shop_hours) == 2) { $array = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"]; for ($i = 0; $i < 3; $i++) { @@ -95,16 +92,17 @@ class Shop extends Controller { $param = $this->request->param(); $upData = [ - 'shop_name' => $param['shop_name']??"", - 'address' => $param['address']??"", - 'phone' => $param['phone']??"", - 'wechat_img_id' => $param['wechat_img_id']??"", + 'shop_name' => $param['shop_name'] ?? "", + 'address' => $param['address'] ?? "", + 'phone' => $param['phone'] ?? "", + 'wechat_img_id' => $param['wechat_img_id'] ?? "", ]; - ShopModel::where('shop_id',$param['shop_id'])->update($upData); + ShopModel::where('shop_id', $param['shop_id'])->update($upData); return $this->renderSuccess('ok'); } - public function getShopInfo(){ + public function getShopInfo() + { $banner_imgs = []; $share_imgs = []; $activity_imgs = []; @@ -117,8 +115,4 @@ class Shop extends Controller } - - - - } \ No newline at end of file diff --git a/app/timer/service/Order.php b/app/timer/service/Order.php index 1699dcf5..7458e204 100644 --- a/app/timer/service/Order.php +++ b/app/timer/service/Order.php @@ -12,13 +12,13 @@ declare (strict_types=1); namespace app\timer\service; -use app\timer\model\Order as OrderModel; +use app\common\enum\order\OrderStatus as OrderStatusEnum; +use app\common\library\helper; use app\common\service\BaseService; use app\common\service\Order as OrderService; use app\common\service\order\Complete as OrderCompleteService; -use app\common\enum\order\OrderStatus as OrderStatusEnum; -use app\common\library\helper; use app\timer\library\Tools; +use app\timer\model\Order as OrderModel; /** * 服务类:订单模块 @@ -38,7 +38,8 @@ class Order extends BaseService public function closeEvent(int $storeId, int $closeHours) { // 截止时间 - $deadlineTime = time() - ((int)$closeHours * 60 * 60); + //$deadlineTime = time() - ((int)$closeHours * 60 * 60);//按小时计算 + $deadlineTime = time() - ($closeHours * 60);//按分钟计算 // 查询截止时间未支付的订单 $model = new OrderModel; $list = $model->getListByClose($storeId, $deadlineTime);