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
91144f10
authored
May 12, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
c31fb1b3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
73 deletions
app/Console/Commands/SetSupplierFollowUp.php
app/Http/Services/DataService.php
app/Http/Transformers/SupplierTransformer.php
app/Console/Commands/SetSupplierFollowUp.php
View file @
91144f10
...
...
@@ -36,6 +36,7 @@ class SetSupplierFollowUp extends Command
//DealImageService::dealNewsImage();
//DealImageService::dealNewsImage();
//DealImageService::dealSkuDetailAndImage();
DataService
::
resetPurchaseUid
(
true
);
//DataService::resetPurchaseUid(true);
DataService
::
exportUploadedSkuSupplier
();
}
}
app/Http/Services/DataService.php
View file @
91144f10
...
...
@@ -538,59 +538,29 @@ class DataService
{
ini_set
(
'memory_limit'
,
-
1
);
$suppliers
=
SupplierChannelModel
::
with
([
'contact'
,
'attachment'
,
'yunxin_account'
])
->
where
(
'uploaded_sku'
,
1
)
->
where
(
'is_type'
,
0
)
->
where
(
'group_code'
,
'!='
,
''
)
->
where
(
'yunxin_channel_uid'
,
'!='
,
''
)
->
orderBy
(
'update_time'
,
'desc'
)
// ->limit(10)
->
get
()
->
toArray
();
$page
=
0
;
$pageSize
=
50
;
$excelData
=
[];
$transformer
=
new
SupplierTransformer
();
$suppliers
=
$transformer
->
transformList
(
$suppliers
);
$suppliers
=
$transformer
->
transformResignChannelUser
(
$suppliers
);
do
{
$suppliers
=
SupplierChannelModel
::
with
([
'contact'
,
'attachment'
,
'yunxin_account'
])
->
where
(
'uploaded_sku'
,
1
)
->
where
(
'is_type'
,
0
)
->
where
(
'group_code'
,
'!='
,
''
)
->
where
(
'yunxin_channel_uid'
,
'!='
,
''
)
->
orderBy
(
'update_time'
,
'desc'
)
->
skip
(
$page
*
$pageSize
)
->
take
(
$pageSize
)
->
get
()
->
toArray
();
Excel
::
create
(
'历史SKU合作且有线上采购员的供应商'
,
function
(
$excel
)
use
(
$suppliers
)
{
$header
=
[
'供应商编码'
,
'集团编码'
,
'供应商名称'
,
'供应商性质'
,
'公司实际性质'
,
'等级'
,
'区域'
,
'合作类型'
,
'代购类型'
,
'品质协议'
,
'平台合作协议'
,
'采购合作框架协议'
,
'启用芯链账号'
,
'通过芯链上传合同'
,
'采购员'
,
'实体名单'
,
'状态'
,
'最新修改人'
,
'签约公司'
,
'联系人'
,
'数据维护员'
,
'线上采购员'
,
'数据跟单员'
,
'SKU上传'
,
'SKU合作'
,
'日均上架数'
,
'有效期最高天数'
,
'创建人'
,
'创建部门'
,
'最近修改时间'
,
'供应商类别'
,
'创建时间'
,
'首次上传sku时间'
,
'最新上传sku时间'
,
];
if
(
empty
(
$suppliers
))
{
break
;
}
$suppliers
=
$transformer
->
transformList
(
$suppliers
);
$suppliers
=
$transformer
->
transformResignChannelUser
(
$suppliers
);
$excelData
=
[];
foreach
(
$suppliers
as
$supplier
)
{
$channelUsername
=
''
;
if
(
!
empty
(
$supplier
[
'resign_channel_username'
]))
{
...
...
@@ -619,46 +589,90 @@ class DataService
$excelData
[]
=
[
$supplier
[
'supplier_code'
],
$supplier
[
'group_code'
]
,
$supplier
[
'group_code'
],
$supplier
[
'supplier_name'
],
$supplier
[
'supplier_group'
],
$supplier
[
'company_nature_name'
],
$supplier
[
'level'
]
,
$supplier
[
'level'
],
$supplier
[
'region_name'
],
$supplier
[
'stockup_type'
],
$supplier
[
'purchase_type_name'
]
,
$supplier
[
'has_quality_assurance_agreement'
]
,
$supplier
[
'has_cooperation_agreement'
]
,
$supplier
[
'has_yunxin_agreement'
]
,
$supplier
[
'purchase_type_name'
],
$supplier
[
'has_quality_assurance_agreement'
],
$supplier
[
'has_cooperation_agreement'
],
$supplier
[
'has_yunxin_agreement'
],
!
empty
(
$supplier
[
'yunxin_account'
])
&&
$supplier
[
'yunxin_account'
][
'a_status'
]
==
1
?
'是'
:
'否'
,
$supplier
[
'has_order_contract'
]
==
1
?
'是'
:
'否'
,
$channelUsername
,
$supplier
[
'is_entity_name'
],
$supplier
[
'status_name'
],
$supplier
[
'last_update_name'
]
,
$supplier
[
'last_update_name'
],
$supplier
[
'sign_com_name'
],
$supplier
[
'contact_num'
]
,
$supplier
[
'purchase_username'
]
,
$supplier
[
'yunxin_channel_username'
]
,
$supplier
[
'contact_num'
],
$supplier
[
'purchase_username'
],
$supplier
[
'yunxin_channel_username'
],
$inventoryUsername
,
$supplier
[
'has_sku'
]
,
$supplier
[
'has_sku'
],
$supplier
[
'uploaded_sku'
]
>
0
?
'是'
:
'否'
,
$supplier
[
'average_sku_num'
]
,
$supplier
[
'average_sku_num'
],
'现货 : '
.
$cpTime
.
' | 期货 : '
.
$futuresCpTime
,
$supplier
[
'create_name'
]
,
$supplier
[
'create_user_department_name'
]
,
$supplier
[
'update_time'
]
,
$supplier
[
'supplier_type_name'
]
,
$supplier
[
'create_time'
]
,
$supplier
[
'sku_create_time'
]
,
$supplier
[
'last_upload_sku_time'
]
,
$supplier
[
'create_name'
],
$supplier
[
'create_user_department_name'
],
$supplier
[
'update_time'
],
$supplier
[
'supplier_type_name'
],
$supplier
[
'create_time'
],
$supplier
[
'sku_create_time'
],
$supplier
[
'last_upload_sku_time'
],
];
}
dump
(
'处理第'
.
$page
.
'页'
);
$page
++
;
}
while
(
count
(
$suppliers
)
==
$pageSize
);
$header
=
[
'供应商编码'
,
'集团编码'
,
'供应商名称'
,
'供应商性质'
,
'公司实际性质'
,
'等级'
,
'区域'
,
'合作类型'
,
'代购类型'
,
'品质协议'
,
'平台合作协议'
,
'采购合作框架协议'
,
'启用芯链账号'
,
'通过芯链上传合同'
,
'采购员'
,
'实体名单'
,
'状态'
,
'最新修改人'
,
'签约公司'
,
'联系人'
,
'数据维护员'
,
'线上采购员'
,
'数据跟单员'
,
'SKU上传'
,
'SKU合作'
,
'日均上架数'
,
'有效期最高天数'
,
'创建人'
,
'创建部门'
,
'最近修改时间'
,
'供应商类别'
,
'创建时间'
,
'首次上传sku时间'
,
'最新上传sku时间'
,
];
$filename
=
'历史SKU合作且有线上采购员的供应商_'
.
date
(
'YmdHis'
);
Excel
::
create
(
$filename
,
function
(
$excel
)
use
(
$excelData
,
$header
)
{
array_unshift
(
$excelData
,
$header
);
$excel
->
sheet
(
'sheet1'
,
function
(
$sheet
)
use
(
$excelData
)
{
$sheet
->
fromArray
(
$excelData
);
});
})
->
download
(
'csv'
);
})
->
store
(
'csv'
,
public_path
(
'export'
));
dump
(
'导出完成: '
.
public_path
(
'export/'
.
$filename
.
'.csv'
));
}
public
static
function
checkSupplierBandAccount
()
...
...
app/Http/Transformers/SupplierTransformer.php
View file @
91144f10
...
...
@@ -102,7 +102,7 @@ class SupplierTransformer
}
else
{
$supplier
[
'has_quality_assurance_agreement'
]
=
'无'
;
}
$supplier
[
'is_own'
]
=
$supplier
[
'create_uid'
]
==
request
()
->
user
->
userId
?
"创建"
:
"指派"
;
$supplier
[
'is_own'
]
=
$supplier
[
'create_uid'
]
==
(
isset
(
request
()
->
user
->
userId
)
?
request
()
->
user
->
userId
:
0
)
?
"创建"
:
"指派"
;
if
(
empty
(
$supplier
[
'create_name'
]))
{
$userInfo
=
$adminUserService
->
getAdminUserInfo
(
$supplier
[
'create_uid'
]);
$supplier
[
'create_name'
]
=
array_get
(
$userInfo
,
'name'
);
...
...
@@ -253,7 +253,7 @@ class SupplierTransformer
$data
[]
=
array_get
(
$userCodes
,
$codeId
);
}
}
else
{
if
(
$codeId
==
request
()
->
user
->
codeId
)
{
if
(
$codeId
==
(
isset
(
request
()
->
user
->
codeId
)
?
request
()
->
user
->
codeId
:
0
)
)
{
$data
[]
=
array_get
(
$userCodes
,
$codeId
);
}
}
...
...
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