Commit 49c5a7fa by 杨树贤

优化部门筛选

parent 6463056f
......@@ -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);
}
......
......@@ -164,7 +164,6 @@ class DepartmentService
$data['children'] = $childrenDepartmentList;
$departmentList[] = $data;
}
return $departmentList;
}
......
......@@ -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';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment