|
|
@ -36,7 +36,7 @@ class CouponRebateService implements CouponRebateServiceInterface |
|
|
$sendUserId = $params["send_user_id"]; |
|
|
$sendUserId = $params["send_user_id"]; |
|
|
$phone = $params["phone"]; |
|
|
$phone = $params["phone"]; |
|
|
$now = time(); |
|
|
$now = time(); |
|
|
$idsData = is_array($ids) ? $ids : explode(',',$ids); |
|
|
|
|
|
|
|
|
$idsData = is_array($ids) ? $ids : explode(',',$ids); |
|
|
|
|
|
|
|
|
// status: 0领取成功 >0领取失败
|
|
|
// status: 0领取成功 >0领取失败
|
|
|
$result = [ |
|
|
$result = [ |
|
|
@ -57,8 +57,8 @@ class CouponRebateService implements CouponRebateServiceInterface |
|
|
$receiveSsdb = []; |
|
|
$receiveSsdb = []; |
|
|
|
|
|
|
|
|
// 判断是否已全部领取
|
|
|
// 判断是否已全部领取
|
|
|
$couponActivity = $ssdb->exec('get', SsdbKeysPrefix::COUPON_REBATE_ACTIVITY); |
|
|
|
|
|
$userReceiveCouponIds = $ssdb->exec('hgetall', SsdbKeysPrefix::COUPON_REBATE_FORWARD . $couponActivity); |
|
|
|
|
|
|
|
|
$couponActivity = $ssdb->exec('hget', SsdbKeysPrefix::COUPON_REBATE_ACTIVITY,0); |
|
|
|
|
|
$userReceiveCouponIds = $ssdb->exec('hgetall', SsdbKeysPrefix::COUPON_REBATE_RECEIVE . $couponActivity . $userId); |
|
|
if($userReceiveCouponIds !== false){ |
|
|
if($userReceiveCouponIds !== false){ |
|
|
$ids = array_diff($idsData, $userReceiveCouponIds); |
|
|
$ids = array_diff($idsData, $userReceiveCouponIds); |
|
|
}else{ |
|
|
}else{ |
|
|
@ -187,7 +187,7 @@ class CouponRebateService implements CouponRebateServiceInterface |
|
|
$saveSsdb[] = $vssdb; |
|
|
$saveSsdb[] = $vssdb; |
|
|
} |
|
|
} |
|
|
// 记录到ssdb
|
|
|
// 记录到ssdb
|
|
|
if(false === $ssdb->exec('multi_hset',SsdbKeysPrefix::COUPON_REBATE_RECEIVE.$userId,$saveSsdb)){ |
|
|
|
|
|
|
|
|
if(false === $ssdb->exec('multi_hset',SsdbKeysPrefix::COUPON_REBATE_RECEIVE . $couponActivity . $userId, $saveSsdb)){ |
|
|
$errorData['msg'] = '记录领取优惠券到ssdb失败'; |
|
|
$errorData['msg'] = '记录领取优惠券到ssdb失败'; |
|
|
$this->log->event( |
|
|
$this->log->event( |
|
|
LogLabel::COUPON_LOG, |
|
|
LogLabel::COUPON_LOG, |
|
|
@ -254,12 +254,12 @@ class CouponRebateService implements CouponRebateServiceInterface |
|
|
|
|
|
|
|
|
$ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); |
|
|
$ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); |
|
|
// $rrss1 = $ssdb->exec('hgetall', SsdbKeysPrefix::COUPON_REBATE_FORWARD . $couponActivity);
|
|
|
// $rrss1 = $ssdb->exec('hgetall', SsdbKeysPrefix::COUPON_REBATE_FORWARD . $couponActivity);
|
|
|
// $rrss2 = $ssdb->exec('get', SsdbKeysPrefix::COUPON_REBATE_REPAY . $couponActivity);
|
|
|
|
|
|
// $rrss3 = $ssdb->exec('get', SsdbKeysPrefix::COUPON_REBATE_ACTIVITY);
|
|
|
|
|
|
// return [$rrss3];
|
|
|
|
|
|
|
|
|
// $rrss2 = $ssdb->exec('hget', SsdbKeysPrefix::COUPON_REBATE_REPAY . $couponActivity,0);
|
|
|
|
|
|
// $rrss3 = $ssdb->exec('hget', SsdbKeysPrefix::COUPON_REBATE_ACTIVITY,0);
|
|
|
|
|
|
// return [$rrss1,$rrss2,$rrss3];
|
|
|
|
|
|
|
|
|
// 记录活动本次 activity_type 活动标志值
|
|
|
// 记录活动本次 activity_type 活动标志值
|
|
|
if (false === $ssdb->exec('set', SsdbKeysPrefix::COUPON_REBATE_ACTIVITY, $couponActivity)) { |
|
|
|
|
|
|
|
|
if (false === $ssdb->exec('hset', SsdbKeysPrefix::COUPON_REBATE_ACTIVITY, [0,$couponActivity])) { |
|
|
|
|
|
|
|
|
$this->log->event( |
|
|
$this->log->event( |
|
|
LogLabel::COUPON_LOG, |
|
|
LogLabel::COUPON_LOG, |
|
|
@ -292,7 +292,7 @@ class CouponRebateService implements CouponRebateServiceInterface |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// 记录返还类型优惠券
|
|
|
// 记录返还类型优惠券
|
|
|
if (false === $ssdb->exec('set', SsdbKeysPrefix::COUPON_REBATE_REPAY . $couponActivity, $couponRepay)) { |
|
|
|
|
|
|
|
|
if (false === $ssdb->exec('hset', SsdbKeysPrefix::COUPON_REBATE_REPAY . $couponActivity, [0,$couponRepay])) { |
|
|
|
|
|
|
|
|
$this->log->event( |
|
|
$this->log->event( |
|
|
LogLabel::COUPON_LOG, |
|
|
LogLabel::COUPON_LOG, |
|
|
|