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
c1c07301
authored
Jan 12, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
上传审核数据初始化
parent
5c3c6e97
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletions
app/Http/Services/DataService.php
app/Http/Services/SupplierService.php
app/Http/routes.php
app/Http/Services/DataService.php
View file @
c1c07301
...
@@ -1683,4 +1683,30 @@ class DataService
...
@@ -1683,4 +1683,30 @@ class DataService
\dump
(
"供应商
{
$value
}
新增跟单员记录"
);
\dump
(
"供应商
{
$value
}
新增跟单员记录"
);
}
}
}
}
public
static
function
initSkuUploadRuler
()
{
$supplierList
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
whereNotIn
(
'supplier_code'
,
[
'L0018319'
,
'L0018562'
,
'L0003270'
,
'L0013521'
])
->
select
([
'supplier_id'
,
'sku_upload_ruler'
])
->
get
()
->
toArray
();
foreach
(
$supplierList
as
$key
=>
$value
)
{
$ruler
=
$value
[
'sku_upload_ruler'
];
if
(
empty
(
$ruler
))
{
continue
;
}
//{"allow_stock_lte_0":0,"allow_moq_lte_0":0,"allow_stock_lt_moq":0,"allow_price_null":0,"futures_allow_stock_lte_0":1,"futures_allow_moq_lte_0":0,"futures_allow_stock_lt_moq":0,"futures_allow_price_null":1}
$ruler
=
json_decode
(
$ruler
,
true
);
$ruler
[
'allow_stock_lte_0'
]
=
0
;
$ruler
[
'allow_price_null'
]
=
0
;
$ruler
[
'futures_allow_price_null'
]
=
0
;
$ruler
[
'futures_allow_stock_lte_0'
]
=
0
;
$ruler
=
\json_encode
(
$ruler
);
SupplierChannelModel
::
where
(
'supplier_id'
,
$value
[
'supplier_id'
])
->
update
([
'sku_upload_ruler'
=>
$ruler
,
]);
$supplierService
=
new
SupplierService
();
$supplierService
->
saveSkuUploadRulerToRedis
(
$value
[
'supplier_id'
],
$ruler
);
}
}
}
}
app/Http/Services/SupplierService.php
View file @
c1c07301
...
@@ -498,6 +498,9 @@ class SupplierService
...
@@ -498,6 +498,9 @@ class SupplierService
public
function
saveSkuUploadRulerToRedis
(
$supplierId
,
$ruler
)
public
function
saveSkuUploadRulerToRedis
(
$supplierId
,
$ruler
)
{
{
if
(
is_array
(
$ruler
))
{
$ruler
=
json_encode
(
$ruler
);
}
$redis
=
new
RedisModel
();
$redis
=
new
RedisModel
();
$redis
->
hset
(
'supplier_sku_upload_ruler'
,
$supplierId
,
$ruler
);
$redis
->
hset
(
'supplier_sku_upload_ruler'
,
$supplierId
,
$ruler
);
}
}
...
...
app/Http/routes.php
View file @
c1c07301
...
@@ -97,5 +97,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
...
@@ -97,5 +97,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
SupplierContactModel
::
where
(
'contact_id'
,
40689
)
->
update
([
'channel_user_type'
=>
4
]
);
DataService
::
initSkuUploadRuler
(
);
});
});
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