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
d571c55d
authored
Apr 26, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复账号问题
parent
0193d720
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
app/Http/Services/SupplierApplyService.php
app/Http/Services/SupplierApplyService.php
View file @
d571c55d
...
...
@@ -77,24 +77,46 @@ class SupplierApplyService
]);
$apply
=
SupplierApplyModel
::
where
(
'id'
,
$applyId
)
->
first
()
->
toArray
();
if
(
$result
)
{
//如果是通过,那么就要替换掉对应供应商的账号和密码
$existAccount
=
SupplierAccountModel
::
where
(
'supplier_code'
,
$apply
[
'supplier_code'
])
->
exists
();
//如果没有供应商账号,那么就要新增供应商账号
if
(
!
$existAccount
)
{
SupplierAccountModel
::
where
(
'supplier_code'
,
$apply
[
'supplier_code'
])
->
update
([
'mobile'
=>
$apply
[
'mobile'
],
'email'
=>
$apply
[
'email'
],
'contacts_name'
=>
$apply
[
'contact_name'
],
'password_raw'
=>
123456
,
'password'
=>
Hash
::
make
(
123456
),
'create_time'
=>
time
(),
'a_type'
=>
1
,
'create_uid'
=>
1000
,
'create_name'
=>
'admin'
,
'source'
=>
2
,
]);
}
else
{
//如果是通过并且已经存在,那么就要替换掉对应供应商的账号和密码
SupplierAccountModel
::
insert
([
'supplier_id'
=>
$apply
[
'supplier_id'
],
'supplier_code'
=>
$apply
[
'supplier_code'
],
'mobile'
=>
$apply
[
'mobile'
],
'update_time'
=>
time
(),
'email'
=>
$apply
[
'email'
],
'contacts_name'
=>
$apply
[
'contact_name'
],
'password_raw'
=>
123456
,
'password'
=>
Hash
::
make
(
123456
),
'source'
=>
2
,
]);
}
//无论是否通过,都要发短信通知
if
(
$status
==
SupplierApplyModel
::
STATUS_REJECT
)
{
$message
=
"${apply['contact_name']} 先生/女生您好,您的“云芯入驻申请”已收到,审核结果为:不通过,原因为:${auditReason},如对审核结果有疑问,可联系您在猎芯的专属渠道经理(周强),联系电话:13512343214,联系邮箱:qiang@ichunt.com"
;
}
else
{
$message
=
"
【猎芯网】
${apply['contact_name']} 先生/女生您好,您的“云芯入驻申请”已收到,审核结果为:通过,云芯登录网址:http://yunxin.ichunt.com,您的云芯登录账号:${apply['mobile']},初始密码:123456,请在登录云芯后修改密码,后续有任何疑问都可联系您在猎芯的专属渠道经理(周强),联系电话:13512343214,联系邮箱:qiang@ichunt.com;"
;
$message
=
"${apply['contact_name']} 先生/女生您好,您的“云芯入驻申请”已收到,审核结果为:通过,云芯登录网址:http://yunxin.ichunt.com,您的云芯登录账号:${apply['mobile']},初始密码:123456,请在登录云芯后修改密码,后续有任何疑问都可联系您在猎芯的专属渠道经理(周强),联系电话:13512343214,联系邮箱:qiang@ichunt.com;"
;
}
$data
=
[];
$data
[
'data'
][
'title'
]
=
$message
;
(
new
MessageService
())
->
sendMessage
(
'supplier_apply_audit_mobile'
,
$data
,
$apply
[
'mobile'
],
true
);
(
new
MessageService
())
->
sendMessage
(
'supplier_apply_audit_email'
,
$data
,
$apply
[
'email'
],
true
);
(
new
MessageService
())
->
sendMessage
(
'supplier_apply_audit_email'
,
'【猎芯网】'
.
$data
,
$apply
[
'email'
],
true
);
}
return
$result
;
}
...
...
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