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
d87b5672
authored
Apr 26, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复bug
parent
d571c55d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
app/Http/Controllers/Api/ExternalApiController.php
app/Http/Controllers/Api/SupplierApplyApiController.php
app/Http/Services/SupplierApplyService.php
app/Http/Controllers/Api/ExternalApiController.php
View file @
d87b5672
...
...
@@ -7,6 +7,7 @@ use App\Http\Controllers\Filter\SupplierFilter;
use
App\Http\Services\AdminUserService
;
use
App\Http\Services\SupplierApplyService
;
use
App\Http\Services\SupplierService
;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierChannelModel
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Validator
;
...
...
@@ -76,6 +77,11 @@ class ExternalApiController extends Controller
if
(
$canApplySupplier
!==
true
)
{
$this
->
externalResponse
(
-
1
,
$canApplySupplier
);
}
//判断这个手机号对应的云芯账号是否已经存在
$existAccount
=
SupplierAccountModel
::
where
(
'mobile'
,
$data
[
'mobile'
])
->
exists
();
if
(
$existAccount
)
{
$this
->
externalResponse
(
-
1
,
'该手机号已经有对应的云芯账号,请重新选择手机号'
);
}
$result
=
(
new
SupplierApplyService
())
->
applySupplier
(
$data
);
if
(
!
$result
)
{
$this
->
externalResponse
(
-
1
,
'申请供应商失败'
);
...
...
app/Http/Controllers/Api/SupplierApplyApiController.php
View file @
d87b5672
...
...
@@ -45,6 +45,12 @@ class SupplierApplyApiController extends Controller
}
$applyId
=
$request
->
get
(
'id'
);
$service
=
new
SupplierApplyService
();
if
(
$status
==
SupplierApplyModel
::
STATUS_PASS
)
{
$check
=
$service
->
checkCanAuditSupplierApply
(
$applyId
);
if
(
$check
!==
true
)
{
$this
->
response
(
-
1
,
$check
);
}
}
$result
=
$service
->
auditSupplierApply
(
$applyId
,
$status
,
$rejectReason
);
if
(
!
$result
)
{
$this
->
response
(
-
1
,
'审核失败'
);
...
...
app/Http/Services/SupplierApplyService.php
View file @
d87b5672
...
...
@@ -64,6 +64,16 @@ class SupplierApplyService
return
SupplierApplyModel
::
insert
(
$data
);
}
public
function
checkCanAuditSupplierApply
(
$applyId
)
{
$supplierId
=
SupplierApplyModel
::
where
(
'id'
,
$applyId
)
->
value
(
'supplier_id'
);
$status
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
value
(
'status'
);
if
(
$status
!=
SupplierChannelModel
::
STATUS_PASSED
)
{
return
"该申请对应的供应商不是通过状态,请检查该供应商的状态"
;
}
return
true
;
}
//审核供应商申请
public
function
auditSupplierApply
(
$applyId
,
$status
,
$auditReason
)
{
...
...
@@ -89,7 +99,6 @@ class SupplierApplyService
'create_time'
=>
time
(),
'a_type'
=>
1
,
'create_uid'
=>
1000
,
'create_name'
=>
'admin'
,
'source'
=>
2
,
]);
}
else
{
...
...
@@ -116,7 +125,7 @@ class SupplierApplyService
$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