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
5817e308
authored
Jul 17, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修改sku采购员同步修改采集供应商的采购员
parent
8cf49a4b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Services/SupplierService.php
app/Http/Controllers/Api/SupplierApiController.php
View file @
5817e308
...
...
@@ -555,6 +555,7 @@ class SupplierApiController extends Controller
$this
->
response
(
-
1
,
'选择的供应商里面不存在对应的线上采购员'
);
}
$supplierService
->
batchAllocateYunxinChannelUser
(
$supplierIds
,
$channelUid
);
dd
(
1223
);
$this
->
response
(
0
,
'批量分配线上采购员成功'
);
}
...
...
app/Http/Services/SupplierService.php
View file @
5817e308
...
...
@@ -6,6 +6,7 @@ namespace App\Http\Services;
use
App\Http\Controllers\Filter\SupplierFilter
;
use
App\Http\Transformers\SupplierTransformer
;
use
App\Http\Validators\SupplierValidator
;
use
App\Model\BigData\DataManageModel
;
use
App\Model\LogModel
;
use
App\Model\RedisModel
;
use
App\Model\SupplierAccountModel
;
...
...
@@ -59,7 +60,6 @@ class SupplierService
}
public
function
saveSupplier
(
$channel
)
{
$supplierTransformer
=
new
SupplierTransformer
();
...
...
@@ -493,14 +493,21 @@ class SupplierService
$logService
=
new
LogService
();
$redis
=
new
RedisModel
();
foreach
(
$supplierIds
as
$supplierId
)
{
$preYunxinChannelUid
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
value
(
'yunxin_channel_uid'
);
$supplier
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
select
([
'supplier_code'
,
'yunxin_channel_uid'
])
->
first
()
->
toArray
();
$preYunxinChannelUid
=
$supplier
[
'yunxin_channel_uid'
];
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'yunxin_channel_uid'
=>
$yunxinChannelUid
]);
//去查找数据对接系统是否有这个供应商,有的话,把采购员也改成这个
DataManageModel
::
where
(
'canal'
,
$supplier
[
'supplier_code'
])
->
update
([
'pur_uid'
=>
$yunxinChannelUid
,
'update_time'
=>
time
(),
]);
$supplier
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
first
()
->
toArray
();
//还要丢队列给批量修改sku的内部编码
$redisKey
=
'lie_supplier_change_yunxin_user_'
.
$supplierId
;
if
(
!
$redis
->
get
(
$redisKey
))
{
if
(
$redis
->
get
(
$redisKey
))
{
$data
=
[
'canal'
=>
$supplier
[
'supplier_code'
],
"encoded"
=>
$yunxinChannelUid
,
...
...
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