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
865d0fea
authored
Mar 02, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化
parent
e390d2ae
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
1 deletions
app/Http/Services/SupplierService.php
app/Http/Services/SupplierService.php
View file @
865d0fea
...
...
@@ -1145,7 +1145,44 @@ class SupplierService
}
$result
[
'debug_info'
][
'assign_type'
]
=
'现货商-分配4人'
;
}
else
{
// 代理商/原厂:随机选商品供应链部数据跟单采购组的其中1人
// 代理商/原厂:只分配1人
// 先检查是否已有数据跟单员
$existingDataFollower
=
SupplierContactModel
::
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'channel_user_type'
,
SupplierContactModel
::
CHANNEL_USER_TYPE_INVENTORY
)
->
first
();
if
(
$existingDataFollower
)
{
// 已有数据跟单员,检查是否有对应的猎芯采购员(同一人)
$existingLiexin
=
SupplierContactModel
::
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'can_check_uids'
,
$existingDataFollower
->
can_check_uids
)
->
where
(
'channel_user_type'
,
SupplierContactModel
::
CHANNEL_USER_TYPE_LIEXIN
)
->
exists
();
if
(
$existingLiexin
)
{
// 已有数据跟单员和对应的猎芯采购员(同一人),跳过
$result
[
'success'
]
=
true
;
$result
[
'reason'
]
=
'代理商/原厂已有猎芯采购和数据跟单员(同一人),跳过'
;
$result
[
'debug_info'
][
'existing_code_id'
]
=
$existingDataFollower
->
can_check_uids
;
return
$result
;
}
else
{
// 有数据跟单员但没有对应的猎芯采购员,用已有的数据跟单员分配猎芯采购
$assignCodeIds
[]
=
$existingDataFollower
->
can_check_uids
;
$result
[
'debug_info'
][
'assign_type'
]
=
'代理商/原厂-使用已有数据跟单员分配猎芯采购'
;
$result
[
'debug_info'
][
'existing_follower_code_id'
]
=
$existingDataFollower
->
can_check_uids
;
}
}
else
{
// 没有数据跟单员,检查是否有猎芯采购
$existingLiexin
=
SupplierContactModel
::
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'channel_user_type'
,
SupplierContactModel
::
CHANNEL_USER_TYPE_LIEXIN
)
->
first
();
if
(
$existingLiexin
)
{
// 有猎芯采购但没有数据跟单员,用已有的猎芯采购员分配数据跟单员
$assignCodeIds
[]
=
$existingLiexin
->
can_check_uids
;
$result
[
'debug_info'
][
'assign_type'
]
=
'代理商/原厂-使用已有猎芯采购分配数据跟单员'
;
$result
[
'debug_info'
][
'existing_liexin_code_id'
]
=
$existingLiexin
->
can_check_uids
;
}
else
{
// 都没有,随机选商品供应链部数据跟单采购组的其中1人
$randomFollower
=
$dataFollowerGroup
[
array_rand
(
$dataFollowerGroup
)];
$codeId
=
$adminUserService
->
getCodeIdByUserName
(
$randomFollower
);
if
(
$codeId
)
{
...
...
@@ -1154,6 +1191,8 @@ class SupplierService
$result
[
'debug_info'
][
'assign_type'
]
=
'代理商/原厂-随机分配1人'
;
$result
[
'debug_info'
][
'random_follower'
]
=
$randomFollower
;
}
}
}
}
elseif
(
$isXinZhiGongYingLian
)
{
// 属于新质供应链部:默认欧阳海梅
$defaultName
=
config
(
'field.XinzhiDefaultDataFollowerName'
,
'欧阳海梅'
);
...
...
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