From b2678ea8112037ed83dff14315b8d6763c2c2f89 Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Tue, 20 Oct 2020 10:52:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8--=E8=AF=A6=E6=83=85?= =?UTF-8?q?tags=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/v3/CouponController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Admin/Controllers/v3/CouponController.php b/app/Admin/Controllers/v3/CouponController.php index 267c7a3..ede6c1e 100644 --- a/app/Admin/Controllers/v3/CouponController.php +++ b/app/Admin/Controllers/v3/CouponController.php @@ -159,8 +159,8 @@ class CouponController extends AdminController }); $show->activity_available->as(function($activityAvailable){ $text = ''; - $activityAvailable = json_decode($activityAvailable); if(!empty($activityAvailable)){ + $activityAvailable = is_array($activityAvailable) ? $activityAvailable : json_decode($activityAvailable); foreach($activityAvailable as $value){ $value = CouponModel::$activityAvailable[$value] ?? ''; $text .= '['.$value.'] '; @@ -170,8 +170,8 @@ class CouponController extends AdminController }); $show->tags->as(function($tags){ $text = ''; - $tags = json_decode($tags); if(!empty($tags)){ + $tags = is_array($tags) ? $tags : json_decode($tags); foreach($tags as $value){ $value = $value ?? ''; $text .= '['.$value.'] ';