From 3d764144c2161174cc0b95ac30b2553a2f9619a3 Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Thu, 6 Aug 2020 15:49:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E8=BF=94=E5=88=B8?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8--=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E6=8E=A5=E5=8F=A3getSystemCouponUse?= =?UTF-8?q?rList?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/CouponRebateService.php | 6 +++--- app/Service/CouponService.php | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/Service/CouponRebateService.php b/app/Service/CouponRebateService.php index da4b6da..8bce00e 100644 --- a/app/Service/CouponRebateService.php +++ b/app/Service/CouponRebateService.php @@ -236,9 +236,9 @@ class CouponRebateService implements CouponRebateServiceInterface ]; $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); - $rrss1 = $ssdb->exec('hgetall', SsdbKeysPrefix::COUPON_REBATE_FORWARD . $couponActivity); - $rrss2 = $ssdb->exec('get', SsdbKeysPrefix::COUPON_REBATE_REPAY . $couponActivity); - return [$rrss1, $rrss2]; + // $rrss1 = $ssdb->exec('hgetall', SsdbKeysPrefix::COUPON_REBATE_FORWARD . $couponActivity); + // $rrss2 = $ssdb->exec('get', SsdbKeysPrefix::COUPON_REBATE_REPAY . $couponActivity); + // return [$rrss2]; // 记录领取类型优惠券 $forwardData = []; foreach ($couponForward as $kForward => $vForward) { diff --git a/app/Service/CouponService.php b/app/Service/CouponService.php index 39c91c8..67f9e56 100644 --- a/app/Service/CouponService.php +++ b/app/Service/CouponService.php @@ -33,7 +33,7 @@ class CouponService implements CouponServiceInterface 'not_receive' => [], 'jump_data' => [ 'src' => "/zh_cjdianc/pages/couponrebate/index?activity_type=".$activityType, - 'src' => "/zh_cjdianc/pages/couponrebate/index?activity_type=".$activityType, + 'src2' => "/zh_cjdianc/pages/couponrebate/index?activity_type=".$activityType, 'coupons' => [] ] ]; @@ -67,8 +67,7 @@ class CouponService implements CouponServiceInterface // 获取领取型优惠券 $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); $couponRebateIds = $ssdb->exec('hgetall',SsdbKeysPrefix::COUPON_REBATE_FORWARD.$activityType); - // $result['active_type'] = $couponRebateIds; - // return $result; + $couponIds = ($couponRebateIds === false || empty($couponRebateIds)) ? $couponIds : array_merge($couponIds,$couponRebateIds) ; $whereC = [ @@ -92,11 +91,13 @@ class CouponService implements CouponServiceInterface ->get(); foreach ($coupons as $k => &$v){ - if($v['active_type'] == 1){ + + if($v->active_type == 1){ $result['not_receive'] = $v; - }else if($v['active_type'] == 2){ - $result['jump_data']['coupons'][] = $v; + }else if($v->active_type == 2){ + $result['jump_data']['coupons'][] = $v->id; } + if($v->discount_type == 2){ $v->discounts = floatval($v->discounts); }