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
b3db4df6
authored
Jun 07, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化统计展示
parent
2e382534
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
app/Http/Services/DataService.php
app/Http/Services/DataService.php
View file @
b3db4df6
...
...
@@ -1217,7 +1217,7 @@ class DataService
}
else
{
$ruler
[
'upload_allow_brands'
]
=
$mainBrands
;
}
dump
(
$supplier
[
'supplier_id'
],
$ruler
);
dump
(
$supplier
[
'supplier_id'
],
$ruler
);
$redis
->
hset
(
'supplier_sku_upload_ruler_v2'
,
$supplier
[
'supplier_id'
],
json_encode
(
$ruler
));
}
}
...
...
@@ -1255,11 +1255,11 @@ class DataService
//找出哪些是云芯上传的
$yunxinUploadSupplierCodes
=
SkuUploadLogModel
::
whereIn
(
'supplier_code'
,
$yunxinSupplierCodes
)
->
where
(
'source'
,
2
)
->
pluck
(
'supplier_code'
)
->
unique
()
->
toArray
();
$skuNumYunxin
=
SupplierChannelModel
::
whereIn
(
'supplier_code'
,
$yunxinUploadSupplierCodes
)
->
sum
(
'sku_num'
);
dump
(
"上架供应商数(不含代购,原厂):"
.
$supplierCount
);
dump
(
"上架云芯供应商数:"
.
count
(
$yunxinUploadSupplierCodes
)
);
dump
(
"SKU 上架总条数(含API接口):"
.
$skuNum1
);
dump
(
"SKU上架总条数(只含云芯):"
.
$skuNumYunxin
);
dump
(
"SKU 上架条数(不含API接口):"
.
$skuNum2
);
echo
(
"<p>上架供应商数(不含代购,原厂):"
.
$supplierCount
.
'</p>'
);
echo
(
"<p>上架云芯供应商数:"
.
count
(
$yunxinUploadSupplierCodes
)
.
'</p>'
);
echo
(
"<p>SKU 上架总条数(含API接口):"
.
$skuNum1
.
'</p>'
);
echo
(
"<p>SKU上架总条数(只含云芯):"
.
$skuNumYunxin
.
'</p>'
);
echo
(
"<p>SKU 上架条数(不含API接口):"
.
$skuNum2
.
'</p>'
);
}
//获取采购系统24号作废的深圳入库明细
...
...
@@ -1359,26 +1359,26 @@ class DataService
}
}
foreach
(
$allBrandsGroupBySupplierCode
as
$supplierCode
=>
$brands
)
{
$supplier
=
SupplierChannelModel
::
select
([
'main_brands'
,
'supplier_id'
,
'supplier_code'
])
->
where
(
'supplier_code'
,
$supplierCode
)
->
first
();
$supplier
=
SupplierChannelModel
::
select
([
'main_brands'
,
'supplier_id'
,
'supplier_code'
])
->
where
(
'supplier_code'
,
$supplierCode
)
->
first
();
if
(
empty
(
$supplier
))
{
continue
;
}
$supplier
=
$supplier
->
toArray
();
$supplier
[
'main_brands'
]
=
trim
(
$supplier
[
'main_brands'
],
','
);
dump
(
'供应商编码 : '
.
$supplierCode
);
dump
(
'供应商编码 : '
.
$supplierCode
);
//找出所有标品的id
$standardBrandIds
=
StandardBrandModel
::
whereIn
(
'brand_name'
,
$brands
)
->
pluck
(
'standard_brand_id'
)
->
toArray
();
dump
(
'excel得出的标品ids : '
.
implode
(
','
,
$standardBrandIds
));
dump
(
'excel得出的标品ids : '
.
implode
(
','
,
$standardBrandIds
));
if
(
$supplier
[
'main_brands'
])
{
dump
(
'原来有标品id :'
.
$supplier
[
'main_brands'
]);
dump
(
'原来有标品id :'
.
$supplier
[
'main_brands'
]);
$supplier
[
'main_brands'
]
=
explode
(
','
,
$supplier
[
'main_brands'
]);
$mainBrands
=
array_merge
(
$supplier
[
'main_brands'
],
$standardBrandIds
);
$mainBrands
=
array_merge
(
$supplier
[
'main_brands'
],
$standardBrandIds
);
}
else
{
$mainBrands
=
$standardBrandIds
;
}
$mainBrands
=
implode
(
','
,
$mainBrands
);
if
(
$isUpdate
)
{
SupplierChannelModel
::
where
(
'supplier_code'
,
$supplierCode
)
->
update
([
SupplierChannelModel
::
where
(
'supplier_code'
,
$supplierCode
)
->
update
([
'main_brands'
=>
$mainBrands
,
]);
}
...
...
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