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
49c5a7fa
authored
Oct 18, 2024
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化部门筛选
parent
6463056f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
app/Http/Controllers/Filter/SupplierFilter.php
app/Http/Services/DepartmentService.php
app/Http/routes.php
app/Http/Controllers/Filter/SupplierFilter.php
View file @
49c5a7fa
...
...
@@ -6,6 +6,7 @@ namespace App\Http\Controllers\Filter;
use
App\Http\Services\AdminUserService
;
use
App\Http\Services\DepartmentService
;
use
App\Model\DepartmentModel
;
use
App\Model\SupplierAttachmentsModel
;
use
App\Model\SupplierChannelModel
;
use
App\Model\UserInfoModel
;
...
...
@@ -193,8 +194,13 @@ class SupplierFilter
//搜索创建部门的数据
if
(
!
empty
(
$map
[
'create_user_department'
]))
{
$map
[
'create_user_department'
]
=
explode
(
','
,
$map
[
'create_user_department'
]);
$parentDepartmentIds
=
DepartmentModel
::
whereIn
(
'department_id'
,
$map
[
'create_user_department'
])
->
pluck
(
'parent_id'
)
->
toArray
();
$parentDepartmentIds
=
array_unique
(
$parentDepartmentIds
);
$departmentIds
=
array_merge
(
$parentDepartmentIds
,
$map
[
'create_user_department'
]);
//先去找出所有的创建人uid
$userIds
=
UserInfoModel
::
whereIn
(
'department_id'
,
$map
[
'create_user_department'
])
->
pluck
(
'userId'
)
->
toArray
();
$userIds
=
UserInfoModel
::
whereIn
(
'department_id'
,
$departmentIds
)
->
pluck
(
'userId'
)
->
toArray
();
dd
(
$userIds
);
$query
->
whereIn
(
'create_uid'
,
$userIds
);
}
...
...
app/Http/Services/DepartmentService.php
View file @
49c5a7fa
...
...
@@ -164,7 +164,6 @@ class DepartmentService
$data
[
'children'
]
=
$childrenDepartmentList
;
$departmentList
[]
=
$data
;
}
return
$departmentList
;
}
...
...
app/Http/routes.php
View file @
49c5a7fa
...
...
@@ -84,7 +84,8 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
\App\Http\Services\DataService
::
exportNameInvalid
();
//\App\Http\Services\DataService::exportNameInvalid();
dd
(
\App\Model\SupplierReceiptModel
::
where
(
'account_no'
,
'like'
,
"%155524553%"
)
->
first
());
//$goodsId = request()->input('goods_id');
//if (empty($goodsId)) {
// return 'goods id null';
...
...
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