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; }