Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
LC_server_goods
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
c212776b
authored
Dec 18, 2019
by
叶明星
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
切换RedisDB
parent
ecd81b28
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
app/Http/Controllers/ServicesController.php
config/database.php
app/Http/Controllers/ServicesController.php
View file @
c212776b
...
...
@@ -9,11 +9,12 @@ use App\Model\SelfGoodsModel;
use
App\Model\SkuModel
;
use
App\Model\SpuModel
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Log
;
class
ServicesController
extends
Controller
{
public
function
synchronization
(){
Log
::
info
(
microtime
(
true
));
$collert
=
TrimX
([
'goods_id'
,
'power'
],
false
);
if
(
empty
(
$collert
[
'goods_id'
]))
return
$this
->
Export
(
$this
->
ProduceErrcode
(
001
,
1
),
'没有SKUID'
);
if
(
empty
(
$collert
[
'power'
]))
...
...
@@ -33,6 +34,7 @@ class ServicesController extends Controller
$data
[
$SkuId
]
=
false
;
$data
[
$SkuId
]
=
$GoodsModel
->
WebSelfGoodsDetail
(
$SkuId
,
$collert
[
'power'
],
$Redis
);
}
Log
::
info
(
microtime
(
true
));
return
$this
->
Export
(
0
,
'success'
,[
'data'
=>
$data
]);
}
...
...
config/database.php
View file @
c212776b
...
...
@@ -171,20 +171,19 @@ return [
'cluster'
=>
env
(
'REDIS_CLUSTER'
,
false
),
'options'
=>
[
'cluster'
=>
env
(
'REDIS_CLUSTER'
,
false
),
'prefix'
=>
env
(
'REDIS_PREFIX'
),
],
'default'
=>
[
'host'
=>
env
(
'REDIS_HOST'
,
'127.0.0.1'
),
'password'
=>
env
(
'REDIS_PASSWORD'
,
null
),
'port'
=>
env
(
'REDIS_PORT'
,
6379
),
'database'
=>
0
,
'database'
=>
1
0
,
'persistent'
=>
true
,
// 开启持久连接
],
'read'
=>
[
'host'
=>
env
(
'REDIS_READ_HOST'
,
''
),
'password'
=>
env
(
'REDIS_READ_PASSWORD'
,
null
),
'port'
=>
env
(
'REDIS_READ_PORT'
,
6379
),
'database'
=>
0
,
'database'
=>
1
0
,
'persistent'
=>
true
,
// 开启持久连接
]
...
...
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