From 9f67970e23a5d8b96794827026ea43cc441f4304 Mon Sep 17 00:00:00 2001 From: Lemon <15040771@qq.com> Date: Mon, 24 Aug 2020 18:46:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E4=B9=B0=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Constants/SsdbKeysPrefix.php | 4 ++-- app/Service/PurchaseLimitService.php | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) 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