From 8d1582cfd590fc03747420ad7a655b002870c425 Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Fri, 7 Aug 2020 10:53:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E8=BF=94?= =?UTF-8?q?=E5=88=B8--=E4=BF=AE=E6=94=B9=E9=A2=86=E5=8F=96=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3-ssdb=E8=AE=B0=E5=BD=95=E5=85=A8=E9=A2=86=E5=8F=96?= =?UTF-8?q?=E7=9A=84=E4=BC=98=E6=83=A0=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/CouponRebateService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Service/CouponRebateService.php b/app/Service/CouponRebateService.php index be0225a..660e433 100644 --- a/app/Service/CouponRebateService.php +++ b/app/Service/CouponRebateService.php @@ -61,6 +61,7 @@ class CouponRebateService implements CouponRebateServiceInterface $userReceiveCouponIds = $ssdb->exec('hgetall', SsdbKeysPrefix::COUPON_REBATE_RECEIVE . $couponActivity . $userId); if($userReceiveCouponIds !== false){ $ids = array_diff($idsData, $userReceiveCouponIds); + $receiveSsdb = $userReceiveCouponIds; }else{ $ids = $idsData; } @@ -129,7 +130,7 @@ class CouponRebateService implements CouponRebateServiceInterface if ( $couponReceive->save() && $coupon->save() ) { $success[] = $coupon; - $receiveSsdb[] = $coupon->id;; + $receiveSsdb[] = $coupon->id; } }else{ $fail[] = $coupon; From e3b323d2a71c432b7a3cf29613e7f7346274af1f Mon Sep 17 00:00:00 2001 From: weigang Date: Fri, 7 Aug 2020 12:06:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?SSDB=20Task=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit e5ead242086db660d887f340c169a222d7c1a94d) --- app/Libs/SimpleSSDB.php | 2 +- app/TaskWorker/SSDBTask.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Libs/SimpleSSDB.php b/app/Libs/SimpleSSDB.php index b6920b2..c829bda 100644 --- a/app/Libs/SimpleSSDB.php +++ b/app/Libs/SimpleSSDB.php @@ -78,7 +78,7 @@ class SSDB function __construct($host, $port, $timeout_ms=2000){ $timeout_f = (float)$timeout_ms/1000; - $this->sock = @stream_socket_client("[$host]:$port", $errno, $errstr, $timeout_f); + $this->sock = @stream_socket_client("$host:$port", $errno, $errstr, $timeout_f); if(!$this->sock){ throw new SSDBException("$errno: $errstr"); } diff --git a/app/TaskWorker/SSDBTask.php b/app/TaskWorker/SSDBTask.php index 9c6ef29..fd4d451 100644 --- a/app/TaskWorker/SSDBTask.php +++ b/app/TaskWorker/SSDBTask.php @@ -24,6 +24,13 @@ class SSDBTask return $result; } + public function execWithoutTask($method,...$args) + { + $result = $this->client()->__call($method,$args); + + return $result; + } + protected function client(){ if ($this->ss instanceof SimpleSSDB) { return $this->ss;