From 3b923246a69530409e50fd76e657b10e17aa0c7b Mon Sep 17 00:00:00 2001 From: weigang Date: Wed, 4 Nov 2020 14:45:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/v3/Implementations/ShareInfoService.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Service/v3/Implementations/ShareInfoService.php b/app/Service/v3/Implementations/ShareInfoService.php index 0bb4d89..1ecfeda 100644 --- a/app/Service/v3/Implementations/ShareInfoService.php +++ b/app/Service/v3/Implementations/ShareInfoService.php @@ -3,6 +3,7 @@ namespace App\Service\v3\Implementations; use App\TaskWorker\SSDBTask; +use Hyperf\Redis\Redis; use Hyperf\Utils\ApplicationContext; class ShareInfoService implements \App\Service\v3\Interfaces\ShareInfoServiceInterface @@ -10,6 +11,12 @@ class ShareInfoService implements \App\Service\v3\Interfaces\ShareInfoServiceInt public function getForApplet() { - return []; + $redis = ApplicationContext::getContainer()->get(Redis::class); + $shareInfos = $redis->hGetAll('program_share_card'); + $shareInfos = array_values($shareInfos); + array_walk($shareInfos, function (&$value, $key) { + $value = json_decode($value, true); + }); + return $shareInfos?:[]; } } \ No newline at end of file