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
3d7ac1b2
authored
Aug 05, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加缓存维护逻辑
parent
e8ed47a9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
0 deletions
app/Http/Controllers/Api/SupplierApiController.php
app/Http/Services/SupplierContactService.php
resources/views/script/UpdateSupplierContactScript.blade.php
app/Http/Controllers/Api/SupplierApiController.php
View file @
3d7ac1b2
...
...
@@ -20,6 +20,7 @@ use App\Http\Services\SyncSupplierService;
use
App\Http\Validators\SupplierValidator
;
use
App\Http\Services\StandardBrandService
;
use
App\Http\Services\SupplierAuditService
;
use
App\Http\Services\SupplierContactService
;
use
App\Http\Transformers\SupplierTransformer
;
use
App\Http\Controllers\Filter\SupplierFilter
;
use
App\Http\Services\SupplierStatisticsService
;
...
...
@@ -511,6 +512,8 @@ class SupplierApiController extends Controller
$result
=
$service
->
allocateChannelUser
(
$supplierId
,
$channelUid
,
$channelUserType
);
}
}
$supplierContactService
=
new
SupplierContactService
();
$supplierContactService
->
updateSupplierCodeData
(
$supplierId
);
}
if
(
!
$result
)
{
...
...
app/Http/Services/SupplierContactService.php
View file @
3d7ac1b2
...
...
@@ -5,6 +5,7 @@ namespace App\Http\Services;
use
App\Model\LogModel
;
use
App\Model\RedisModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierContactModel
;
...
...
@@ -98,6 +99,8 @@ class SupplierContactService
$logService
->
AddLog
(
$contact
[
'supplier_id'
],
LogModel
::
UPDATE_OPERATE
,
'修改供应商基本资料'
,
$content
,
$remark
);
}
$this
->
updateSupplierCodeData
(
$supplierId
);
return
$result
;
}
...
...
@@ -197,4 +200,18 @@ class SupplierContactService
}
return
$result
;
}
public
function
updateSupplierCodeData
(
$supplierId
)
{
//还要把采购员的列表写到特定redis字段给商品新增服务使用
$supplier
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
select
([
'supplier_code'
,
'channel_uid'
])
->
first
();
$redis
=
new
RedisModel
();
$supplierCodeData
=
$redis
->
hget
(
'supplier_code'
,
$supplier
->
supplier_code
);
if
(
$supplierCodeData
)
{
$supplierCodeData
=
json_decode
(
$supplierCodeData
,
true
);
$supplierCodeData
[
'channel_uid'
]
=
$supplier
->
channel_uid
;
$redis
->
hset
(
'supplier_code'
,
$supplier
->
supplier_code
,
json_encode
(
$supplierCodeData
));
}
}
}
resources/views/script/UpdateSupplierContactScript.blade.php
0 → 100644
View file @
3d7ac1b2
<script>
layui
.
use
([
'table'
,
'form'
,
'element'
,
'layer'
,
'admin'
],
function
()
{
let
admin
=
layui
.
admin
;
let
form
=
layui
.
form
;
let
element
=
layui
.
element
;
$
(
'#supplier_email'
).
blur
(
function
()
{
let
value
=
$
(
this
).
val
();
value
=
value
.
trim
();
if
(
value
!==
''
)
{
let
reg
=
/^
([
a-zA-Z0-9_-
])
+@
([
a-zA-Z0-9_-
])
+
(
.
[
a-zA-Z0-9_-
])
+/
;
if
(
!
reg
.
test
(
value
)){
layer
.
msg
(
'邮箱格式不对'
,
{
icon
:
5
});
}
}
});
form
.
on
(
'submit(load)'
,
function
(
data
)
{
// layer.confirm('确定要保存联系人吗?一旦保存,该供应商就会再次进入审核阶段', function (index) {
let
supplierId
=
getQueryVariable
(
'supplier_id'
);
let
url
=
'/api/supplier_contact/SaveSupplierContact?supplier_id='
+
supplierId
;
let
res
=
ajax
(
url
,
data
.
field
);
if
(
!
res
)
{
layer
.
msg
(
'网络错误,请重试'
,
{
icon
:
6
});
}
else
{
if
(
res
.
err_code
===
0
)
{
admin
.
putTempData
(
"needFreshList"
,
1
);
admin
.
closeThisDialog
();
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
6
});
}
else
{
parent
.
layer
.
msg
(
res
.
err_msg
,
{
icon
:
5
});
}
}
});
return
false
;
// });
});
</script>
\ No newline at end of file
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