From 7fdba93322e0c4e9cc54042889d70a8112cd32e3 Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Thu, 6 Aug 2020 16:50:07 +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--=E8=AE=B0=E5=BD=95=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=A0=87=E8=AF=86=E5=80=BCactivity=5Ftype?= =?UTF-8?q?=E5=88=B0ssdb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Constants/SsdbKeysPrefix.php | 5 +++++ app/Service/CouponRebateService.php | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/app/Constants/SsdbKeysPrefix.php b/app/Constants/SsdbKeysPrefix.php index d747600..1e721c2 100644 --- a/app/Constants/SsdbKeysPrefix.php +++ b/app/Constants/SsdbKeysPrefix.php @@ -31,4 +31,9 @@ class SsdbKeysPrefix extends AbstractConstants * @Message("Coupon rebate Key Prefix") */ const COUPON_REBATE_REPAY = 'coupon_rebate_repay_'; + + /** + * @Message("Coupon rebate Key Prefix") + */ + const COUPON_REBATE_ACTIVITY = 'coupon_rebate_activity'; } diff --git a/app/Service/CouponRebateService.php b/app/Service/CouponRebateService.php index 8bce00e..f46e973 100644 --- a/app/Service/CouponRebateService.php +++ b/app/Service/CouponRebateService.php @@ -233,12 +233,28 @@ class CouponRebateService implements CouponRebateServiceInterface $result = [ 'forward' => true, 'repay' => true, + 'activity' => true, ]; $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 [$rrss2]; + // $rrss3 = $ssdb->exec('get', SsdbKeysPrefix::COUPON_REBATE_ACTIVITY); + // return [$rrss3]; + + // 记录活动本次 activity_type 活动标志值 + if (false === $ssdb->exec('set', SsdbKeysPrefix::COUPON_REBATE_ACTIVITY, $couponActivity)) { + + $this->log->event( + LogLabel::COUPON_LOG, + [ + 'coupon_activity' => $couponActivity, + 'msg' => '记录活动标志值(activity_type)到ssdb失败' + ] + ); + $result['activity'] = false; + }; + // 记录领取类型优惠券 $forwardData = []; foreach ($couponForward as $kForward => $vForward) { @@ -272,6 +288,7 @@ class CouponRebateService implements CouponRebateServiceInterface ); $result['repay'] = false; }; + return $result; }