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
a74a4919
authored
Dec 05, 2019
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复升级版本后的兼容问题
parent
9604c3f1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
app/Model/UnitModel.php
app/Model/UnitModel.php
View file @
a74a4919
...
@@ -16,7 +16,7 @@ class UnitModel extends Model
...
@@ -16,7 +16,7 @@ class UnitModel extends Model
$Find
=
$Redis
->
hget
(
'Self_Unit'
,
$UnitID
);
$Find
=
$Redis
->
hget
(
'Self_Unit'
,
$UnitID
);
if
(
!
$Find
){
if
(
!
$Find
){
if
(
empty
(
$this
->
connection
))
$this
->
connection
=
'self'
;
if
(
empty
(
$this
->
connection
))
$this
->
connection
=
'self'
;
$list
=
$this
->
lists
(
'unit_name'
,
'unit_id'
)
->
toArray
();
$list
=
$this
->
pluck
(
'unit_name'
,
'unit_id'
)
->
toArray
();
$Redis
->
hmset
(
'Self_Unit'
,
$list
);
$Redis
->
hmset
(
'Self_Unit'
,
$list
);
return
empty
(
$list
[
$UnitID
])
?
''
:
$list
[
$UnitID
];
return
empty
(
$list
[
$UnitID
])
?
''
:
$list
[
$UnitID
];
}
else
{
}
else
{
...
@@ -30,7 +30,7 @@ class UnitModel extends Model
...
@@ -30,7 +30,7 @@ class UnitModel extends Model
$Find
=
$Redis
->
hget
(
'Self_UnitAlias'
,
$UnitID
);
$Find
=
$Redis
->
hget
(
'Self_UnitAlias'
,
$UnitID
);
if
(
!
$Find
){
if
(
!
$Find
){
if
(
empty
(
$this
->
connection
))
$this
->
connection
=
'self'
;
if
(
empty
(
$this
->
connection
))
$this
->
connection
=
'self'
;
$list
=
$this
->
lists
(
'unit_name_alias'
,
'unit_id'
)
->
toArray
();
$list
=
$this
->
pluck
(
'unit_name_alias'
,
'unit_id'
)
->
toArray
();
$Redis
->
hmset
(
'Self_UnitAlias'
,
$list
);
$Redis
->
hmset
(
'Self_UnitAlias'
,
$list
);
return
empty
(
$list
[
$UnitID
])
?
''
:
$list
[
$UnitID
];
return
empty
(
$list
[
$UnitID
])
?
''
:
$list
[
$UnitID
];
}
else
{
}
else
{
...
...
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