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
e4c9fdf8
authored
Apr 27, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化脚本
parent
c25041ab
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
22 deletions
app/Http/Services/DataService.php
app/Http/routes.php
resources/views/script/SupplierListScript.blade.php
app/Http/Services/DataService.php
View file @
e4c9fdf8
...
...
@@ -1885,7 +1885,8 @@ class DataService
];
}
public
static
function
handleMixTypeSupplier
()
{
public
static
function
handleMixTypeSupplier
()
{
$supplierList
=
SupplierChannelModel
::
where
(
'supplier_group'
,
SupplierChannelModel
::
SUPPLIER_GROUP_MIX
)
->
limit
(
2
)
->
get
()
->
toArray
();
foreach
(
$supplierList
as
$supplier
)
{
$supplierId
=
$supplier
[
'supplier_id'
];
...
...
@@ -2001,11 +2002,6 @@ class DataService
$oldChannelUid
=
$supplier
[
'channel_uid'
];
$channelUidArray
=
explode
(
','
,
trim
(
$oldChannelUid
,
','
));
// 移除京东采购员ID
$newChannelUidArray
=
array_diff
(
$channelUidArray
,
$channelUids
);
$newChannelUid
=
implode
(
','
,
$newChannelUidArray
);
$newChannelUid
=
trim
(
$newChannelUid
,
','
);
if
(
$updateData
)
{
// 删除联系人
SupplierContactModel
::
where
(
'supplier_id'
,
$supplierId
)
...
...
@@ -2013,6 +2009,11 @@ class DataService
->
whereIn
(
'can_check_uids'
,
$channelUids
)
->
delete
();
$newChannelUid
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplier
[
'supplier_id'
])
->
pluck
(
'can_check_uids'
)
->
toArray
();
if
(
empty
(
$newChannelUid
))
{
continue
;
}
$newChannelUid
=
\implode
(
','
,
$newChannelUid
);
// 更新channel_uid
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'channel_uid'
=>
$newChannelUid
,
...
...
@@ -2039,6 +2040,4 @@ class DataService
dump
(
"已删除
{
$count
}
个京东采购员类型的联系人"
);
}
}
}
app/Http/routes.php
View file @
e4c9fdf8
...
...
@@ -97,5 +97,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
SupplierChannelModel
::
where
(
'supplier_code'
,
'L0011042'
)
->
update
([
'status'
=>
2
]
);
DataService
::
deleteAllJdChannelUser
(
false
);
});
resources/views/script/SupplierListScript.blade.php
View file @
e4c9fdf8
...
...
@@ -270,19 +270,6 @@
{
field
:
'purchase_username'
,
title
:
'数据维护员'
,
align
:
'center'
,
width
:
110
},
{
field
:
'yunxin_channel_username'
,
title
:
'线上采购员'
,
align
:
'center'
,
width
:
110
},
{
field
:
'jd_channel_username'
,
title
:
'京东采购员'
,
align
:
'center'
,
width
:
130
,
templet
:
function
(
data
)
{
if
(
data
.
jd_resign_channel_username
)
{
if
(
data
.
jd_on_job_channel_username
)
{
return
`<span>
${
data
.
jd_on_job_channel_username
}
</span>`
+
`,<span style="color: #D7D7D7">
${
data
.
jd_resign_channel_username
}
</span>`
;
}
else
{
return
`<span style="color: #D7D7D7">
${
data
.
jd_resign_channel_username
}
</span>`
}
}
else
{
return
`<span>
${
data
.
jd_on_job_channel_username
}
</span>`
;
}
}
},
{
field
:
'inventory_channel_username'
,
title
:
'数据跟单员'
,
align
:
'center'
,
width
:
130
,
templet
:
function
(
data
)
{
if
(
data
.
inventory_resign_channel_username
)
{
if
(
data
.
inventory_on_job_channel_username
)
{
...
...
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