From 854e3d8a6b2dd34ad82fa8e21bb7fa9cfd98b87d Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Sat, 5 Sep 2020 14:24:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=B1=E6=95=88=E5=8E=9F=E5=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v3/Implementations/ShopCartService.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/Service/v3/Implementations/ShopCartService.php b/app/Service/v3/Implementations/ShopCartService.php index 83c426b..a50e49b 100644 --- a/app/Service/v3/Implementations/ShopCartService.php +++ b/app/Service/v3/Implementations/ShopCartService.php @@ -36,6 +36,21 @@ class ShopCartService implements ShopCartServiceInterface ->get(); foreach ($res as &$k){ $k->subtotal = '99.90'; + foreach ($k->ShoppingCart as &$v){ + switch (mt_rand(1,3)) { + case 1: + $str = '已下架'; + break; + case 2: + $str = '已抢光'; + break; + case 3: + $str = '已打烊'; + break; + } + $v['goods']['invalid_cause'] = $str; + } + } return $res; }