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
5f2b7ba8
authored
Jul 20, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'ysx-spu的redis拆库-20230705'
parents
5d05f55b
33ea4d43
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 @
5f2b7ba8
...
...
@@ -99,6 +99,9 @@ REDIS_READ_HOST=redis.liexindev.me
REDIS_READ_PASSWORD=icDb29mLy2s
REDIS_READ_PORT=6379
REDIS_SPU_HOST=192.168.1.234
REDIS_SPU_PASSWORD=icDb29mLy1s
REDIS_SPU_PORT=6379
RABBITMQ_HOST=192.168.1.252
RABBITMQ_PORT=5672
...
...
app/Http/Services/SkuService.php
View file @
5f2b7ba8
...
...
@@ -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
;
...
...
@@ -38,6 +39,7 @@ class SkuService
if
(
isset
(
$data
[
'error_code'
])
&&
$data
[
'error_code'
]
==
0
)
{
$redis
=
new
RedisModel
;
//处理供应商
$spuRedis
=
Redis
::
connection
(
'spu'
);
foreach
(
$data
[
'data'
][
'goods_id'
]
as
$k
=>
$goodsId
)
{
$uploadItemService
=
new
SkuUploadItemService
();
$auditData
=
$uploadItemService
->
getSkuAuditData
(
$data
[
'data'
][
'goods_id'
]);
...
...
@@ -60,7 +62,7 @@ class SkuService
}
//添加sku是否过期
$sku
[
'is_expire'
]
=
$data
[
'data'
][
'status'
][
$goodsId
]
&&
$data
[
'data'
][
'status'
][
$goodsId
]
>
0
?
0
:
1
;
$spu
=
json_decode
(
$
r
edis
->
hget
(
'spu'
,
$sku
[
'spu_id'
]),
true
);
$spu
=
json_decode
(
$
spuR
edis
->
hget
(
'spu'
,
$sku
[
'spu_id'
]),
true
);
//型号处理
if
(
empty
(
$sku
[
'goods_name'
])
&&
!
empty
(
$spu
))
{
$sku
[
'goods_name'
]
=
$spu
[
'spu_name'
];
...
...
config/database.php
View file @
5f2b7ba8
...
...
@@ -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