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
ed2a10a4
authored
Oct 09, 2024
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
检查数据
parent
9e3c1e78
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
4 deletions
app/Http/Services/DataService.php
app/Http/routes.php
public/data/爱智平台SKU汇总表-2024.09.19.xlsx
resources/views/script/SkuListScript.blade.php
app/Http/Services/DataService.php
View file @
ed2a10a4
...
...
@@ -667,11 +667,38 @@ class DataService
dd
(
$mongo
);
}
public
static
function
importBrandAndMapping
(
)
public
static
function
updateIedgeSkuName
(
$isUpdate
=
false
)
{
ini_set
(
'memory_limit'
,
'2048M'
);
$filePath
=
public_path
(
'data'
)
.
DIRECTORY_SEPARATOR
.
'爱智平台SKU汇总表-2024.09.19.xlsx'
;
Excel
::
selectSheetsByIndex
(
0
)
->
load
(
$filePath
,
function
(
$reader
)
use
(
$isUpdate
)
{
$reader
->
sheet
(
'细分商品分类'
,
function
()
use
(
$reader
,
$isUpdate
)
{
foreach
(
$reader
->
all
()
->
toArray
()
as
$key
=>
$item
)
{
if
(
$key
==
0
||
$key
>
100
)
{
continue
;
}
$skuId
=
trim
(
trim
(
$item
[
1
]),
"
\t
"
);
$oldSkuName
=
trim
(
trim
(
$item
[
2
],
"
\t
"
));
$newSkuName
=
trim
(
trim
(
$item
[
3
],
"
\t
"
));
dump
(
$skuId
,
$oldSkuName
,
$newSkuName
);
//直接去修改sku的sku_name
$dbInfo
=
getSpuSkuDb
(
$skuId
);
$connection
=
DB
::
connection
(
$dbInfo
[
"db"
]);
$table
=
$dbInfo
[
'table'
];
$skuName
=
$connection
->
table
(
$table
)
->
where
(
'goods_id'
,
$skuId
)
->
value
(
'goods_name'
);
if
(
empty
(
$skuName
))
{
dump
(
'sku_id找不到'
);
}
dump
(
$skuName
);
}
});
});
}
}
app/Http/routes.php
View file @
ed2a10a4
...
...
@@ -84,7 +84,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
\App\Http\Services\DataService
::
getSpuAttrs
();
\App\Http\Services\DataService
::
updateIedgeSkuName
();
//\App\Http\Services\DealImageService::replaceCmsImage();
//\App\Http\Services\SupplierAddressService::initUnitedAddress();
//\App\Http\Services\DataService::checkSupplierBandAccount();
...
...
public/data/爱智平台SKU汇总表-2024.09.19.xlsx
0 → 100644
View file @
ed2a10a4
No preview for this file type
resources/views/script/SkuListScript.blade.php
View file @
ed2a10a4
...
...
@@ -65,7 +65,12 @@
let
cols
=
[
{
type
:
'checkbox'
},
{
field
:
'goods_id'
,
title
:
'SKUID'
,
align
:
'center'
,
width
:
180
},
{
field
:
'goods_images'
,
title
:
'goods_images'
,
align
:
'center'
,
width
:
180
},
// {
// field: 'goods_images', title: '商品图片', width: 80, templet: function (data) {
// return data.brand_logo ? "
<
a
href
=
'" + data.goods_images + "'
target
=
'_blank'
>
" +
// "
<
img
class
=
'goods_images'
style
=
'width: 40px;height: 20px'
src
=
'" + data.goods_images + "'
><
/a>" : '无'
;
// }
// },
{
field
:
'status_name'
,
title
:
'状态'
,
align
:
'center'
,
width
:
70
,
templet
:
function
(
d
)
{
return
d
.
goods_status
==
1
?
"
<
a
class
=
'layui-btn layui-btn-xs'
>
上架
<
/a>"
:
...
...
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