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
Show 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;
...
@@ -7,6 +7,7 @@ use App\Http\Controllers\Filter\SupplierFilter;
use
App\Http\Services\AdminUserService
;
use
App\Http\Services\AdminUserService
;
use
App\Http\Services\SupplierApplyService
;
use
App\Http\Services\SupplierApplyService
;
use
App\Http\Services\SupplierService
;
use
App\Http\Services\SupplierService
;
use
App\Model\SupplierAccountModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\SupplierChannelModel
;
use
Illuminate\Http\Request
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Validator
;
use
Illuminate\Support\Facades\Validator
;
...
@@ -76,6 +77,11 @@ class ExternalApiController extends Controller
...
@@ -76,6 +77,11 @@ class ExternalApiController extends Controller
if
(
$canApplySupplier
!==
true
)
{
if
(
$canApplySupplier
!==
true
)
{
$this
->
externalResponse
(
-
1
,
$canApplySupplier
);
$this
->
externalResponse
(
-
1
,
$canApplySupplier
);
}
}
//判断这个手机号对应的云芯账号是否已经存在
$existAccount
=
SupplierAccountModel
::
where
(
'mobile'
,
$data
[
'mobile'
])
->
exists
();
if
(
$existAccount
)
{
$this
->
externalResponse
(
-
1
,
'该手机号已经有对应的云芯账号,请重新选择手机号'
);
}
$result
=
(
new
SupplierApplyService
())
->
applySupplier
(
$data
);
$result
=
(
new
SupplierApplyService
())
->
applySupplier
(
$data
);
if
(
!
$result
)
{
if
(
!
$result
)
{
$this
->
externalResponse
(
-
1
,
'申请供应商失败'
);
$this
->
externalResponse
(
-
1
,
'申请供应商失败'
);
...
...
app/Http/Controllers/Api/SupplierApplyApiController.php
View file @
d87b5672
...
@@ -45,6 +45,12 @@ class SupplierApplyApiController extends Controller
...
@@ -45,6 +45,12 @@ class SupplierApplyApiController extends Controller
}
}
$applyId
=
$request
->
get
(
'id'
);
$applyId
=
$request
->
get
(
'id'
);
$service
=
new
SupplierApplyService
();
$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
);
$result
=
$service
->
auditSupplierApply
(
$applyId
,
$status
,
$rejectReason
);
if
(
!
$result
)
{
if
(
!
$result
)
{
$this
->
response
(
-
1
,
'审核失败'
);
$this
->
response
(
-
1
,
'审核失败'
);
...
...
app/Http/Services/SupplierApplyService.php
View file @
d87b5672
...
@@ -64,6 +64,16 @@ class SupplierApplyService
...
@@ -64,6 +64,16 @@ class SupplierApplyService
return
SupplierApplyModel
::
insert
(
$data
);
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
)
public
function
auditSupplierApply
(
$applyId
,
$status
,
$auditReason
)
{
{
...
@@ -89,7 +99,6 @@ class SupplierApplyService
...
@@ -89,7 +99,6 @@ class SupplierApplyService
'create_time'
=>
time
(),
'create_time'
=>
time
(),
'a_type'
=>
1
,
'a_type'
=>
1
,
'create_uid'
=>
1000
,
'create_uid'
=>
1000
,
'create_name'
=>
'admin'
,
'source'
=>
2
,
'source'
=>
2
,
]);
]);
}
else
{
}
else
{
...
@@ -116,7 +125,7 @@ class SupplierApplyService
...
@@ -116,7 +125,7 @@ class SupplierApplyService
$data
=
[];
$data
=
[];
$data
[
'data'
][
'title'
]
=
$message
;
$data
[
'data'
][
'title'
]
=
$message
;
(
new
MessageService
())
->
sendMessage
(
'supplier_apply_audit_mobile'
,
$data
,
$apply
[
'mobile'
],
true
);
(
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
;
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