Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ef58fdcf
authored
Jul 05, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
迁移spu的缓存完成
parent
96cdec3b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletions
.env
app/Http/Services/SkuService.php
config/database.php
.env
View file @
ef58fdcf
...
...
@@ -99,6 +99,9 @@ REDIS_READ_HOST=redis.liexindev.me
REDIS_READ_PASSWORD=icDb29mLy2s
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_PORT=5672
...
...
app/Http/Services/SkuService.php
View file @
ef58fdcf
...
...
@@ -12,6 +12,7 @@ use App\Model\SupplierChannelModel;
use
App\Model\TagsModel
;
use
GuzzleHttp\Client
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\Redis
;
use
PhpAmqpLib\Connection\AMQPStreamConnection
;
use
PhpAmqpLib\Message\AMQPMessage
;
...
...
@@ -58,7 +59,8 @@ class SkuService
}
//添加sku是否过期
$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
))
{
$sku
[
'goods_name'
]
=
$spu
[
'spu_name'
];
...
...
config/database.php
View file @
ef58fdcf
...
...
@@ -426,6 +426,13 @@ return [
'port'
=>
env
(
'REDIS_USER_PORT'
,
6379
),
'database'
=>
0
,
'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
]
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment