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
fb82b414
authored
Jul 25, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
初始化数据脚本
parent
221d6b83
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletions
app/Http/Services/DataService.php
app/Http/routes.php
app/Http/Services/DataService.php
View file @
fb82b414
...
...
@@ -31,6 +31,7 @@ use Illuminate\Support\Facades\Redis;
use
Maatwebsite\Excel\Facades\Excel
;
use
PhpAmqpLib\Connection\AMQPStreamConnection
;
use
PhpAmqpLib\Message\AMQPMessage
;
use
PhpParser\Node\Stmt\DeclareDeclare
;
//这个服务是处理数据的,比如导出信息,或者临时修复数据,所以代码会比较多
class
DataService
...
...
@@ -1581,4 +1582,19 @@ class DataService
}
}
//初始化期货有效期
public
function
initFuturesCpTime
()
{
$redis
=
new
RedisModel
();
$cpTimeList
=
$redis
->
hgetall
(
'supplier_sku_upload_ruler_v2'
);
foreach
(
$cpTimeList
as
$key
=>
$cpTime
)
{
$cpTime
=
json_decode
(
$cpTime
,
true
);
if
(
empty
(
$cpTime
[
'upload_futures_goods_validity_period'
]))
{
$cpTime
[
'upload_futures_goods_validity_period'
]
=
365
;
}
$cpTime
=
json_encode
(
$cpTime
);
$redis
->
hset
(
'supplier_sku_upload_ruler_v2'
,
$key
,
$cpTime
);
}
}
}
\ No newline at end of file
app/Http/routes.php
View file @
fb82b414
...
...
@@ -81,7 +81,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
// (new \App\Http\Services\SupplierService())->initialCpTimeDays(15307, 5);
// (new \App\Http\Services\DataService())->initSkuRulers
();
(
new
\App\Http\Services\DataService
())
->
initFuturesCpTime
();
// (new \App\Http\Services\DataService())->initialMainBrandsLimit();
// (new \App\Http\Services\DataService())->initialMainBrandsToSkuRuler();
...
...
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