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
e6b9fb38
authored
May 19, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化
parent
b2bb2ce7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
app/Model/SupplierExtendModel.php
app/Model/SupplierExtendModel.php
View file @
e6b9fb38
...
...
@@ -70,20 +70,20 @@ class SupplierExtendModel extends Model
public
function
getExtendExtra
(
$SupplierCode
=
''
,
$SupplierID
=
''
)
{
if
(
empty
(
$SupplierCode
))
return
false
;
$Redis
=
new
RedisModel
();
$pre
=
Config
(
'fixed.SUPPLIER_REDIS_PRE'
);
$SUPPLIER_ID
=
Config
(
'fixed.SUPPLIER_ID'
);
// 联营供应商ID 17
$extendInfo
=
$Redis
->
hget
(
$pre
,
$SUPPLIER_ID
.
'.'
.
$SupplierCode
);
// 联营供应商ID是17,储存内容格式如下{"max":2000,"price":10}
if
(
empty
(
$extendInfo
))
{
// 先从数据库获取
$charge_content
=
$this
->
select
([
'charge_content'
])
->
where
(
'supplier_id'
,
'='
,
$SupplierID
)
->
where
(
'status'
,
'='
,
1
)
->
first
();
$extendInfo
=
''
;
if
(
!
empty
(
$charge_content
))
{
$charge_content
=
$charge_content
->
toArray
();
$extendInfo
=
$charge_content
[
'charge_content'
];
}
// 如果数据库有数据,同步到 Redis
if
(
!
empty
(
$extendInfo
))
{
$Redis
=
new
RedisModel
();
$pre
=
Config
(
'fixed.SUPPLIER_REDIS_PRE'
);
$SUPPLIER_ID
=
Config
(
'fixed.SUPPLIER_ID'
);
// 联营供应商ID 17
$Redis
->
hset
(
$pre
,
$SUPPLIER_ID
.
'.'
.
$SupplierCode
,
$extendInfo
);
}
}
if
(
$extendInfo
)
{
$extendInfo
=
json_decode
(
$extendInfo
,
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