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
0ba3f372
authored
May 29, 2026
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复各种bug
parent
61edcda0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
20 deletions
app/Http/Controllers/Filter/LogFilter.php
app/Http/Controllers/Filter/SupplierLogFilter.php
app/Http/Controllers/Sync/SupplierSyncController.php
app/Http/Services/LogService.php
app/Http/Services/SupplierAuditService.php
app/Http/Controllers/Filter/LogFilter.php
View file @
0ba3f372
...
@@ -36,12 +36,17 @@ class LogFilter
...
@@ -36,12 +36,17 @@ class LogFilter
$departmentService
=
new
DepartmentService
();
$departmentService
=
new
DepartmentService
();
//下属用户id(结果包括自己的id)
//下属用户id(结果包括自己的id)
$subordinateUserIds
=
$departmentService
->
getSubordinateUserIds
(
$adminId
);
$subordinateUserIds
=
$departmentService
->
getSubordinateUserIds
(
$adminId
);
// 系统操作日志(admin_id=0)对所有用户可见
$subordinateUserIds
[]
=
0
;
$query
->
whereIn
(
'admin_id'
,
$subordinateUserIds
);
$query
->
whereIn
(
'admin_id'
,
$subordinateUserIds
);
}
else
{
}
else
{
//剩下的就只是看自己相关的
//剩下的就只是看自己相关的
$query
->
where
(
'admin_id'
,
$adminId
);
// 加上系统操作日志(admin_id=0)对所有用户可见
$query
->
where
(
function
(
$q
)
use
(
$adminId
)
{
$q
->
where
(
'admin_id'
,
$adminId
)
->
orWhere
(
'admin_id'
,
0
);
});
}
}
}
}
return
$query
;
return
$query
;
}
}
}
}
\ No newline at end of file
app/Http/Controllers/Filter/SupplierLogFilter.php
View file @
0ba3f372
...
@@ -29,15 +29,17 @@ class SupplierLogFilter
...
@@ -29,15 +29,17 @@ class SupplierLogFilter
//可以查看所有的话,默认不做任何限制
//可以查看所有的话,默认不做任何限制
}
elseif
(
$canViewSubordinateLog
)
{
}
elseif
(
$canViewSubordinateLog
)
{
//如果能看部下的,那需要判断的地方就多了不少
//如果能看部下的,那需要判断的地方就多了不少
if
(
$canViewSubordinateLog
)
{
$departmentService
=
new
DepartmentService
();
$departmentService
=
new
DepartmentService
();
//下属用户id(结果包括自己的id)
//下属用户id(结果包括自己的id)
$subordinateUserIds
=
$departmentService
->
getSubordinateUserIds
(
$adminId
);
$subordinateUserIds
=
$departmentService
->
getSubordinateUserIds
(
$adminId
);
// 系统操作日志(admin_id=0)对所有用户可见
$query
->
whereIn
(
'admin_id'
,
$subordinateUserIds
);
$subordinateUserIds
[]
=
0
;
}
else
{
$query
->
whereIn
(
'admin_id'
,
$subordinateUserIds
);
//剩下的就只是看自己相关的
}
else
{
$query
->
where
(
'admin_id'
,
$adminId
);
// 剩下的就只是看自己相关的,加上系统操作日志
}
$query
->
where
(
function
(
$q
)
use
(
$adminId
)
{
$q
->
where
(
'admin_id'
,
$adminId
)
->
orWhere
(
'admin_id'
,
0
);
});
}
}
return
$query
;
return
$query
;
}
}
...
...
app/Http/Controllers/Sync/SupplierSyncController.php
View file @
0ba3f372
...
@@ -512,7 +512,6 @@ class SupplierSyncController extends BaseSyncController
...
@@ -512,7 +512,6 @@ class SupplierSyncController extends BaseSyncController
}
}
$supplierId
=
$supplier
[
'supplier_id'
];
$supplierId
=
$supplier
[
'supplier_id'
];
try
{
try
{
// 更新逆向采购员
// 更新逆向采购员
$extend
=
SupplierExtendModel
::
where
(
'supplier_id'
,
$supplierId
)
->
first
();
$extend
=
SupplierExtendModel
::
where
(
'supplier_id'
,
$supplierId
)
->
first
();
...
@@ -541,4 +540,4 @@ class SupplierSyncController extends BaseSyncController
...
@@ -541,4 +540,4 @@ class SupplierSyncController extends BaseSyncController
$this
->
syncResponse
(
-
1
,
'更新失败: '
.
$e
->
getMessage
());
$this
->
syncResponse
(
-
1
,
'更新失败: '
.
$e
->
getMessage
());
}
}
}
}
}
}
\ No newline at end of file
app/Http/Services/LogService.php
View file @
0ba3f372
...
@@ -14,8 +14,8 @@ class LogService
...
@@ -14,8 +14,8 @@ class LogService
//添加日志
//添加日志
public
function
AddLog
(
$supplierId
,
$type
,
$action
,
$content
,
$remark
=
''
)
public
function
AddLog
(
$supplierId
,
$type
,
$action
,
$content
,
$remark
=
''
)
{
{
$adminId
=
isset
(
request
()
->
user
->
userId
)
?
request
()
->
user
->
userId
:
0
;
$adminId
=
isset
(
request
()
->
user
->
userId
)
?
request
()
->
user
->
userId
:
100
0
;
$adminName
=
isset
(
request
()
->
user
->
name
)
?
request
()
->
user
->
name
:
''
;
$adminName
=
isset
(
request
()
->
user
->
name
)
?
request
()
->
user
->
name
:
'
admin
'
;
$data
=
[
$data
=
[
'supplier_id'
=>
$supplierId
,
'supplier_id'
=>
$supplierId
,
'type'
=>
$type
,
'type'
=>
$type
,
...
...
app/Http/Services/SupplierAuditService.php
View file @
0ba3f372
...
@@ -658,12 +658,13 @@ class SupplierAuditService
...
@@ -658,12 +658,13 @@ class SupplierAuditService
];
];
if
(
!
empty
(
$channelUid
))
{
if
(
!
empty
(
$channelUid
))
{
$updateData
[
'channel_uid'
]
=
$channelUid
;
$updateData
[
'channel_uid'
]
=
$channelUid
;
// 同步更新联系人表的 can_check_uids
SupplierContactModel
::
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'channel_user_type'
,
SupplierContactModel
::
CHANNEL_USER_TYPE_LIEXIN
)
->
update
([
'can_check_uids'
=>
$channelUid
]);
}
}
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
update
(
$updateData
);
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
update
(
$updateData
);
SupplierContactModel
::
where
(
'supplier_id'
,
$supplierId
)
->
update
([
'can_check_uids'
=>
$channelUid
,
]);
// 回传CRM系统:转化供应商状态更新为完成
// 回传CRM系统:转化供应商状态更新为完成
$supplierName
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
value
(
'supplier_name'
);
$supplierName
=
SupplierChannelModel
::
where
(
'supplier_id'
,
$supplierId
)
->
value
(
'supplier_name'
);
CrmService
::
confirmCrmSupplier
(
$supplierId
,
$supplierName
,
$approverName
,
1
,
$remark
);
CrmService
::
confirmCrmSupplier
(
$supplierId
,
$supplierName
,
$approverName
,
1
,
$remark
);
...
@@ -731,4 +732,4 @@ class SupplierAuditService
...
@@ -731,4 +732,4 @@ class SupplierAuditService
);
);
return
$flowInfo
;
return
$flowInfo
;
}
}
}
}
\ No newline at end of file
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