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
5017175f
authored
Aug 09, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
bd9ba22a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
app/Http/Controllers/Api/SupplierShareApplyApiController.php
app/Http/Controllers/Api/SupplierShareApplyApiController.php
View file @
5017175f
...
...
@@ -38,12 +38,17 @@ class SupplierShareApplyApiController extends Controller
}
$userId
=
$request
->
user
->
userId
;
$codeId
=
$request
->
user
->
codeId
;
if
(
empty
(
$codeId
))
{
$this
->
response
(
-
1
,
'你还没有绑定内部编码,无法申请共用'
);
}
//要判断自己是不是有这个供应商了,有的话没必要申请
$isOwn
=
$supplierModel
->
where
(
'supplier_name'
,
$supplierName
)
->
where
(
function
(
$q
)
use
(
$userId
,
$codeId
)
{
$q
->
where
(
'create_uid'
,
$userId
)
->
orWhere
(
'purchase_uid'
,
$codeId
)
->
orwhere
(
'channel_uid'
,
'like'
,
"%
$codeId
%"
);
})
->
where
(
'is_type'
,
0
)
->
count
();
$q
->
where
(
'create_uid'
,
$userId
);
if
(
!
empty
(
$codeId
))
{
$q
->
orWhere
(
'purchase_uid'
,
$codeId
)
->
orwhere
(
'channel_uid'
,
'like'
,
"%
$codeId
%"
);
}
})
->
where
(
'is_type'
,
0
)
->
first
();
if
(
$isOwn
)
{
$this
->
response
(
-
1
,
'你已经可以管理该供应商,无需申请共用'
);
}
...
...
@@ -74,6 +79,9 @@ class SupplierShareApplyApiController extends Controller
if
(
empty
(
$map
[
'apply_department_id'
])
||
empty
(
$map
[
'supplier_id'
]))
{
$this
->
response
(
-
1
,
'缺少参数'
);
}
if
(
empty
(
$request
->
user
->
codeId
))
{
$this
->
response
(
-
1
,
'你还没有绑定内部编码,无法申请共用'
);
}
$map
[
'apply_code_id'
]
=
$request
->
user
->
codeId
;
$applyService
=
new
SupplierShareApplyService
();
$hasNoFinish
=
$applyService
->
checkHasNoFinishApply
(
$map
);
...
...
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