Commit 09072b5f by mushishixian

fix

parent 68df0fa7
......@@ -110,6 +110,7 @@ class SupplierFilter
$subordinateUserIds = $departmentService->getSubordinateUserIds($userId);
$adminUserService = new AdminUserService();
$subordinateCodeIds = $adminUserService->getCodeIdsByUserIds($subordinateUserIds);
$subordinateCodeIds = $subordinateCodeIds->toArray();
//因为可以查看自己部下相关的采购员,开发员的供应商,所以要构建复杂likeIn语句需要的数据
//注意下面三个条件最外层要用()包围起来,要不然mysql数据会有问题,具体自己查询mysql的and和or的语法注意事项
$likeSqlRaw = implode('|', $subordinateCodeIds);
......@@ -118,6 +119,7 @@ class SupplierFilter
$inCodeIdSql = "(" . $inCodeIdSql . ")";
$inUserIdSql = "(" . $inUserIdSql . ")";
$query->whereRaw(DB::raw("(create_uid in $inUserIdSql or purchase_uid in $inCodeIdSql or channel_uid REGEXP '$likeSqlRaw') "));
} else {
//剩下的就只是看自己相关的
$query->whereRaw(DB::raw("(create_uid = $userId or purchase_uid = $codeId or channel_uid like '%${codeId}%') "));
......
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