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
d04b7e73
authored
Jun 01, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
最近修改人忽略审核flag
parent
f90507b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
12 deletions
app/Http/Services/DataService.php
app/Http/Transformers/SupplierTransformer.php
app/Model/LogModel.php
app/Http/Services/DataService.php
View file @
d04b7e73
...
...
@@ -952,7 +952,8 @@ class DataService
$logModel
=
new
LogModel
();
foreach
(
$suppliers
as
$supplier
)
{
$log
=
$logModel
->
where
(
'supplier_id'
,
$supplier
[
'supplier_id'
])
->
where
(
'type'
,
LogModel
::
UPDATE_OPERATE
)
->
orderBy
(
'id'
,
'desc'
)
->
first
();
->
where
(
'type'
,
LogModel
::
UPDATE_OPERATE
)
->
where
(
'ignore_audit_check'
,
0
)
->
orderBy
(
'id'
,
'desc'
)
->
first
();
$supplier
[
'last_update_name'
]
=
$log
[
'admin_name'
]
?:
'无'
;
if
(
empty
(
$supplier
[
'create_name'
]))
{
$userInfo
=
(
new
AdminUserService
())
->
getAdminUserInfo
(
$supplier
[
'create_uid'
]);
...
...
@@ -1224,7 +1225,7 @@ class DataService
//初始化品牌数量限制(还要跳过API对接的供应商)
public
function
initialMainBrandsLimit
()
{
$suppliers
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
where
(
'main_brands_limit'
,
0
)
->
get
()
->
toArray
();
$suppliers
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
where
(
'main_brands_limit'
,
0
)
->
get
()
->
toArray
();
foreach
(
$suppliers
as
$supplier
)
{
//判断是否是API对接的供应商
if
(
DataManageModel
::
where
(
'canal'
,
$supplier
[
'supplier_code'
])
->
where
(
'is_type'
,
0
)
->
exists
())
{
...
...
@@ -1251,8 +1252,8 @@ class DataService
$supplierCount
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
where
(
'supplier_group'
,
'!='
,
4
)
->
whereNotIn
(
'supplier_name'
,
config
(
'field.SkipChangeSupplierTypeNames'
))
->
where
(
'sku_num'
,
'>'
,
0
)
->
count
();
$yunxinSupplierCodes
=
SupplierChannelModel
::
where
(
'is_type'
,
0
)
->
where
(
'stockup_type'
,
'like'
,
'%5%'
)
->
where
(
'sku_num'
,
'>'
,
0
)
->
pluck
(
'supplier_code'
);
//找出哪些是云芯上传的
$yunxinUploadSupplierCodes
=
SkuUploadLogModel
::
whereIn
(
'supplier_code'
,
$yunxinSupplierCodes
)
->
where
(
'source'
,
2
)
->
pluck
(
'supplier_code'
)
->
unique
()
->
toArray
();
$skuNumYunxin
=
SupplierChannelModel
::
whereIn
(
'supplier_code'
,
$yunxinUploadSupplierCodes
)
->
sum
(
'sku_num'
);
$yunxinUploadSupplierCodes
=
SkuUploadLogModel
::
whereIn
(
'supplier_code'
,
$yunxinSupplierCodes
)
->
where
(
'source'
,
2
)
->
pluck
(
'supplier_code'
)
->
unique
()
->
toArray
();
$skuNumYunxin
=
SupplierChannelModel
::
whereIn
(
'supplier_code'
,
$yunxinUploadSupplierCodes
)
->
sum
(
'sku_num'
);
dump
(
"上架供应商数(不含代购,原厂):"
.
$supplierCount
);
dump
(
"上架云芯供应商数:"
.
count
(
$yunxinUploadSupplierCodes
));
dump
(
"SKU 上架总条数(含API接口):"
.
$skuNum1
);
...
...
app/Http/Transformers/SupplierTransformer.php
View file @
d04b7e73
...
...
@@ -68,9 +68,7 @@ class SupplierTransformer
$lastUploadSkuTimes
[
$supplier
[
'supplier_code'
]])
:
''
;
//获取最新修改人以及下级审核员
$logModel
=
new
LogModel
();
$log
=
$logModel
->
where
(
'supplier_id'
,
$supplier
[
'supplier_id'
])
->
where
(
'type'
,
LogModel
::
UPDATE_OPERATE
)
->
orderBy
(
'id'
,
'desc'
)
->
first
();
$log
=
LogModel
::
getLastLog
(
$supplier
[
'supplier_id'
]);
$supplier
[
'last_update_name'
]
=
$log
?
$log
[
'admin_name'
]
:
''
;
$supplier
[
'last_update_time'
]
=
$log
?
date
(
'Y-m-d H:i:s'
,
$log
[
'add_time'
])
:
''
;
//黑名单
...
...
@@ -201,9 +199,7 @@ class SupplierTransformer
$supplier
[
'supplier_type_name'
]
=
array_get
(
config
(
'field.SupplierType'
),
$supplier
[
'supplier_type'
]);
}
//获取最近修改信息
$logModel
=
new
LogModel
();
$log
=
$logModel
->
where
(
'supplier_id'
,
$supplier
[
'supplier_id'
])
->
where
(
'type'
,
LogModel
::
UPDATE_OPERATE
)
->
orderBy
(
'id'
,
'desc'
)
->
first
();
$log
=
LogModel
::
getLastLog
(
$supplier
[
'supplier_id'
]);
$supplier
[
'last_update_name'
]
=
$log
[
'admin_name'
]
?:
'无'
;
$supplier
[
'last_update_time'
]
=
empty
(
$supplier
[
'last_update_time'
])
?
(
$log
[
'add_time'
]
?
date
(
'Y-m-d H:i:s'
,
$log
[
'add_time'
])
:
'无'
)
:
'无'
;
...
...
app/Model/LogModel.php
View file @
d04b7e73
...
...
@@ -6,11 +6,21 @@ use Illuminate\Database\Eloquent\Model;
class
LogModel
extends
Model
{
protected
$connection
=
'web'
;
protected
$table
=
'log'
;
protected
$connection
=
'web'
;
protected
$table
=
'log'
;
public
$timestamps
=
false
;
const
UPDATE_OPERATE
=
1
;
const
ADD_OPERATE
=
2
;
const
VIEW_OPERATE
=
3
;
public
static
function
getLastLog
(
$supplierId
,
$ignoreAuditCheck
=
true
)
{
$query
=
self
::
where
(
'supplier_id'
,
$supplierId
)
->
where
(
'type'
,
LogModel
::
UPDATE_OPERATE
);
if
(
$ignoreAuditCheck
)
{
$query
->
where
(
'ignore_audit_check'
,
0
);
}
return
$query
->
where
(
'ignore_audit_check'
,
0
)
->
orderBy
(
'id'
,
'desc'
)
->
first
();
}
}
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