From 6708ac5d47722561790158c941218df6ba9eab37 Mon Sep 17 00:00:00 2001 From: xucong <850806214@qq.com> Date: Thu, 4 Sep 2025 16:26:08 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=8F=90=E4=BA=A4=E7=BC=BA=E5=A4=B1=E7=9A=84?= =?UTF-8?q?=E4=B8=9C=E8=A5=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/CartLogic.php | 9 ++++++++- app/api/logic/OrderLogic.php | 10 +--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/app/api/logic/CartLogic.php b/app/api/logic/CartLogic.php index ad4b53a..25a7e55 100644 --- a/app/api/logic/CartLogic.php +++ b/app/api/logic/CartLogic.php @@ -50,7 +50,14 @@ class CartLogic } if ($info) { - if($goods_num + $info['goods_num'] > 2 || $goods_num >2){ + $goods_cart = Cart::where("goods_id",$goods['goods_id']) + ->where("user_id",$user_id) + ->select(); + $count = 0; + foreach($goods_cart as $key=>$value){ + $count+=$value['goods_num']; + } + if($count + $info['goods_num'] > 2 || $count >2){ return '每单限额两套'; } diff --git a/app/api/logic/OrderLogic.php b/app/api/logic/OrderLogic.php index b8087b8..f80100b 100644 --- a/app/api/logic/OrderLogic.php +++ b/app/api/logic/OrderLogic.php @@ -926,17 +926,9 @@ class OrderLogic extends LogicBase } public static function getYuyueTime($data){ - $time = "TIME( - CONCAT( - LPAD(SUBSTRING_INDEX(start_time, ':', 1), 2, '0'), - ':', - LPAD(SUBSTRING_INDEX(start_time, ':', -1), 2, '0'), - ':00' - ) - )"; return Db::name("order_yuyetime") ->where("store_id",$data['store_id']) - ->order($time) + ->orderRaw("STR_TO_DATE(start_time, '%H:%i')") ->select() ->toArray(); }