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
2d5b9796
authored
Mar 20, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化判断
parent
84207fea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
app/Http/Services/AdminUserService.php
app/Http/Services/SupplierService.php
app/Http/Services/AdminUserService.php
View file @
2d5b9796
...
...
@@ -36,9 +36,13 @@ class AdminUserService
return
$userInfoModel
->
whereIn
(
'userId'
,
$adminIds
)
->
get
()
->
toArray
();
}
public
function
getCodeIdByUserName
(
$userName
)
public
function
getCodeIdByUserName
(
$userName
,
$isOnWork
=
false
)
{
$userId
=
UserInfoModel
::
where
(
'name'
,
$userName
)
->
value
(
'userId'
);
$query
=
UserInfoModel
::
where
(
'name'
,
$userName
);
if
(
$isOnWork
)
{
$query
=
$query
->
where
(
'status'
,
'!='
,
4
);
}
$userId
=
$query
->
value
(
'userId'
);
$codeId
=
IntracodeModel
::
where
(
'admin_id'
,
$userId
)
->
value
(
'code_id'
);
return
$codeId
;
}
...
...
@@ -124,6 +128,4 @@ class AdminUserService
$intraCodeModel
=
new
IntracodeModel
();
return
$intraCodeModel
->
getEncodeByUserIds
(
$userIds
);
}
}
app/Http/Services/SupplierService.php
View file @
2d5b9796
...
...
@@ -1138,7 +1138,7 @@ class SupplierService
if
(
$supplierGroup
==
SupplierChannelModel
::
SUPPLIER_GROUP_SPOT
)
{
// 现货商:分配商品供应链部数据跟单采购组的4个人
foreach
(
$dataFollowerGroup
as
$followerName
)
{
$codeId
=
$adminUserService
->
getCodeIdByUserName
(
$followerName
);
$codeId
=
$adminUserService
->
getCodeIdByUserName
(
$followerName
,
true
);
if
(
$codeId
)
{
$assignCodeIds
[]
=
$codeId
;
}
...
...
@@ -1181,7 +1181,7 @@ class SupplierService
$existingLiexinCodeId
=
$existingLiexin
->
can_check_uids
;
$isInDataFollowerGroup
=
false
;
foreach
(
$dataFollowerGroup
as
$followerName
)
{
$codeId
=
$adminUserService
->
getCodeIdByUserName
(
$followerName
);
$codeId
=
$adminUserService
->
getCodeIdByUserName
(
$followerName
,
true
);
if
(
$codeId
&&
$codeId
==
$existingLiexinCodeId
)
{
$isInDataFollowerGroup
=
true
;
break
;
...
...
@@ -1196,7 +1196,7 @@ class SupplierService
}
else
{
// 猎芯采购不是四个人中的一个,随机选商品供应链部数据跟单采购组的其中1人
$randomFollower
=
$dataFollowerGroup
[
array_rand
(
$dataFollowerGroup
)];
$codeId
=
$adminUserService
->
getCodeIdByUserName
(
$randomFollower
);
$codeId
=
$adminUserService
->
getCodeIdByUserName
(
$randomFollower
,
true
);
if
(
$codeId
)
{
$assignCodeIds
[]
=
$codeId
;
}
...
...
@@ -1207,7 +1207,7 @@ class SupplierService
}
else
{
// 都没有,随机选商品供应链部数据跟单采购组的其中1人
$randomFollower
=
$dataFollowerGroup
[
array_rand
(
$dataFollowerGroup
)];
$codeId
=
$adminUserService
->
getCodeIdByUserName
(
$randomFollower
);
$codeId
=
$adminUserService
->
getCodeIdByUserName
(
$randomFollower
,
true
);
if
(
$codeId
)
{
$assignCodeIds
[]
=
$codeId
;
}
...
...
@@ -1219,7 +1219,7 @@ class SupplierService
}
elseif
(
$isXinZhiGongYingLian
)
{
// 属于新质供应链部:默认欧阳海梅
$defaultName
=
config
(
'field.XinzhiDefaultDataFollowerName'
,
'欧阳海梅'
);
$codeId
=
$adminUserService
->
getCodeIdByUserName
(
$defaultName
);
$codeId
=
$adminUserService
->
getCodeIdByUserName
(
$defaultName
,
true
);
if
(
$codeId
)
{
$assignCodeIds
[]
=
$codeId
;
}
...
...
@@ -1336,7 +1336,7 @@ class SupplierService
$isProdMode
=
(
$mode
===
'prod'
);
// 构建查询
$query
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
where
(
'supplier_id'
,
'>'
,
13856
)
$query
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
where
(
'supplier_id'
,
'>'
,
13856
)
->
where
(
'yunxin_channel_uid'
,
'!='
,
''
);
// 如果num>0则限制数量,否则不限制
...
...
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