Commit ef58fdcf by 杨树贤

迁移spu的缓存完成

parent 96cdec3b
...@@ -99,6 +99,9 @@ REDIS_READ_HOST=redis.liexindev.me ...@@ -99,6 +99,9 @@ REDIS_READ_HOST=redis.liexindev.me
REDIS_READ_PASSWORD=icDb29mLy2s REDIS_READ_PASSWORD=icDb29mLy2s
REDIS_READ_PORT=6379 REDIS_READ_PORT=6379
REDIS_SPU_HOST=redis.liexindev.me
REDIS_SPU_PASSWORD=icDb29mLy2s
REDIS_SPU_PORT=6379
RABBITMQ_HOST=192.168.1.252 RABBITMQ_HOST=192.168.1.252
RABBITMQ_PORT=5672 RABBITMQ_PORT=5672
......
...@@ -12,6 +12,7 @@ use App\Model\SupplierChannelModel; ...@@ -12,6 +12,7 @@ use App\Model\SupplierChannelModel;
use App\Model\TagsModel; use App\Model\TagsModel;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
use PhpAmqpLib\Connection\AMQPStreamConnection; use PhpAmqpLib\Connection\AMQPStreamConnection;
use PhpAmqpLib\Message\AMQPMessage; use PhpAmqpLib\Message\AMQPMessage;
...@@ -58,7 +59,8 @@ class SkuService ...@@ -58,7 +59,8 @@ class SkuService
} }
//添加sku是否过期 //添加sku是否过期
$sku['is_expire'] = $data['data']['status'][$goodsId] && $data['data']['status'][$goodsId] > 0 ? 0 : 1; $sku['is_expire'] = $data['data']['status'][$goodsId] && $data['data']['status'][$goodsId] > 0 ? 0 : 1;
$spu = json_decode($redis->hget('spu', $sku['spu_id']), true); $spuRedis = Redis::connection('spu');
$spu = json_decode($spuRedis->hget('spu', $sku['spu_id']), true);
//型号处理 //型号处理
if (empty($sku['goods_name']) && !empty($spu)) { if (empty($sku['goods_name']) && !empty($spu)) {
$sku['goods_name'] = $spu['spu_name']; $sku['goods_name'] = $spu['spu_name'];
......
...@@ -426,6 +426,13 @@ return [ ...@@ -426,6 +426,13 @@ return [
'port' => env('REDIS_USER_PORT', 6379), 'port' => env('REDIS_USER_PORT', 6379),
'database' => 0, 'database' => 0,
'read_write_timeout' => 0,//new 'read_write_timeout' => 0,//new
],
'spu' => [
'host' => env('REDIS_SPU_HOST', ''),
'password' => env('REDIS_SPU_PASSWORD', null),
'port' => env('REDIS_SPU_PORT', 6379),
'database' => 0,
'read_write_timeout' => 0,//new
] ]
], ],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment