diff --git a/app/Constants/SsdbKeysPrefix.php b/app/Constants/SsdbKeysPrefix.php index b29fa48..00e7bf1 100644 --- a/app/Constants/SsdbKeysPrefix.php +++ b/app/Constants/SsdbKeysPrefix.php @@ -48,7 +48,7 @@ class SsdbKeysPrefix extends AbstractConstants const COUPON_REBATE_LIST = 'coupon_rebate_list_'; /** - * @Message("Coupon rebate List") + * @Message("PURCHASE RECORD") */ - const PURCHASE_LIMIT = 'purchase_limit_'; + const PURCHASE_RECORD = 'purchase_record_'; } diff --git a/app/Service/PurchaseLimitService.php b/app/Service/PurchaseLimitService.php index 093b418..cc581bb 100644 --- a/app/Service/PurchaseLimitService.php +++ b/app/Service/PurchaseLimitService.php @@ -19,7 +19,7 @@ class PurchaseLimitService implements PurchaseLimitServiceInterface { //获取ssdb购买记录 $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); - $record_exists = $ssdb->exec('hexists',SsdbKeysPrefix::PURCHASE_LIMIT. date('Ymd') .'_'.$params['user_id'], $params['good_id']); + $record_exists = $ssdb->exec('hexists',SsdbKeysPrefix::PURCHASE_RECORD. date('Ymd') .'_'.$params['user_id'], $params['good_id']); if($record_exists) { $error = [ @@ -209,6 +209,12 @@ class PurchaseLimitService implements PurchaseLimitServiceInterface public function test($params) { - return $params; + $ssdb = ApplicationContext::getContainer()->get(SSDBTask::class); + //添加领取记录到ssdb + $data = [ + '620',1561, + ]; + $test = $ssdb->exec('multi_hset', SsdbKeysPrefix::PURCHASE_RECORD. date('Ymd') .'_620', $data); + return $test; } } \ No newline at end of file