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
54c1cad7
authored
Dec 22, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复时间以及数据
parent
5571650a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
11 deletions
app/Http/Services/DataService.php
app/Http/Services/SupplierService.php
app/Http/function.php
app/Http/Services/DataService.php
View file @
54c1cad7
...
@@ -928,19 +928,25 @@ class DataService
...
@@ -928,19 +928,25 @@ class DataService
public
static
function
initSupplierCacche
()
public
static
function
initSupplierCacche
()
{
{
ini_set
(
'memory_limit'
,
'512M'
);
ini_set
(
'memory_limit'
,
'512M'
);
$supplierList
=
SupplierChannelModel
::
select
([
$supplierList
=
SupplierChannelModel
::
get
()
->
toArray
();
'supplier_id'
,
'supplier_code'
,
'supplier_name'
])
->
get
()
->
toArray
();
$redis
=
new
RedisModel
();
$redis
=
new
RedisModel
();
foreach
(
$supplierList
as
$supplier
)
{
foreach
(
$supplierList
as
$supplier
)
{
$supplierId
=
$supplier
[
'supplier_id'
];
$data
=
[
$supplierCode
=
$supplier
[
'supplier_code'
];
'supplier_id'
=>
$supplier
[
'supplier_id'
],
$supplierName
=
$supplier
[
'supplier_name'
];
'supplier_code'
=>
$supplier
[
'supplier_code'
],
Log
::
info
(
'初始化供应商缓存:'
.
$supplierId
.
' '
.
$supplierCode
.
' '
.
$supplierName
);
'supplier_name'
=>
$supplier
[
'supplier_name'
],
'stockup_type'
=>
$supplier
[
'stockup_type'
],
'status'
=>
$supplier
[
'status'
],
'supplier_group'
=>
$supplier
[
'supplier_group'
],
'channel_uid'
=>
$supplier
[
'channel_uid'
],
'purchase_uid'
=>
$supplier
[
'purchase_uid'
],
'is_type'
=>
$supplier
[
'is_type'
],
'region'
=>
$supplier
[
'region'
],
'group_code'
=>
$supplier
[
'group_code'
],
];
// 这里可以添加具体的缓存初始化逻辑
// 这里可以添加具体的缓存初始化逻辑
$redis
->
hset
(
'lie_supplier_info'
,
$supplier
[
'supplier_id'
],
json_encode
(
$
supplier
));
$redis
->
hset
(
'lie_supplier_info'
,
$supplier
[
'supplier_id'
],
json_encode
(
$
data
));
}
}
}
}
}
}
app/Http/Services/SupplierService.php
View file @
54c1cad7
...
@@ -436,6 +436,20 @@ class SupplierService
...
@@ -436,6 +436,20 @@ class SupplierService
//什么都不需要操作
//什么都不需要操作
}
}
$redis
=
new
RedisModel
();
$redis
->
hset
(
'liexin_supplier_info'
,
$supplierId
,
json_encode
([
'supplier_id'
=>
$supplierId
,
'supplier_code'
=>
$newSupplier
[
'supplier_code'
],
'supplier_name'
=>
$newSupplier
[
'supplier_name'
],
'stockup_type'
=>
$newSupplier
[
'stockup_type'
],
'status'
=>
$newSupplier
[
'status'
],
'supplier_group'
=>
$newSupplier
[
'supplier_group'
],
'channel_uid'
=>
$newSupplier
[
'channel_uid'
],
'purchase_uid'
=>
$newSupplier
[
'purchase_uid'
],
'is_type'
=>
$newSupplier
[
'is_type'
],
'region'
=>
$newSupplier
[
'region'
],
'group_code'
=>
$newSupplier
[
'group_code'
],
]));
return
$supplierId
;
return
$supplierId
;
}
}
...
...
app/Http/function.php
View file @
54c1cad7
...
@@ -20,7 +20,7 @@ function apiReturn($errCode = 0, $errMsg = 'ok', $data = [])
...
@@ -20,7 +20,7 @@ function apiReturn($errCode = 0, $errMsg = 'ok', $data = [])
return
response
()
->
json
(
$data
,
200
);
return
response
()
->
json
(
$data
,
200
);
}
}
function
curl
(
$url
,
$params
=
false
,
$isPost
=
0
,
$https
=
0
,
$cookie
=
''
,
$timeout
=
100
0
)
function
curl
(
$url
,
$params
=
false
,
$isPost
=
0
,
$https
=
0
,
$cookie
=
''
,
$timeout
=
2
0
)
{
{
$ch
=
curl_init
();
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_HTTP_VERSION
,
CURL_HTTP_VERSION_1_1
);
curl_setopt
(
$ch
,
CURLOPT_HTTP_VERSION
,
CURL_HTTP_VERSION_1_1
);
...
...
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