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
cacabeb6
authored
May 10, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
品质协议展示问题
parent
641e4576
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
app/Http/Transformers/SupplierTransformer.php
resources/views/script/SupplierListScript.blade.php
app/Http/Transformers/SupplierTransformer.php
View file @
cacabeb6
...
...
@@ -41,6 +41,7 @@ class SupplierTransformer
$supplier
[
'region_name'
]
=
array_get
(
config
(
'fixed.Region'
),
$supplier
[
'region'
],
'暂无'
);
$supplier
[
'contact_num'
]
=
$this
->
getContactNum
(
$supplier
[
'supplier_id'
]);
$supplier
[
'has_sku'
]
=
$supplier
[
'sku_num'
]
?
'是'
:
'否'
;
$supplier
[
'has_quality_assurance_agreement'
]
=
$this
->
checkHasQualityAssuranceAgreement
(
$supplier
[
'attachment'
])
?
'有'
:
'无'
;
$supplier
[
'is_own'
]
=
$supplier
[
'create_uid'
]
==
request
()
->
user
->
userId
?
"创建"
:
"指派"
;
if
(
empty
(
$supplier
[
'create_name'
]))
{
$userInfo
=
$adminUserService
->
getAdminUserInfo
(
$supplier
[
'create_uid'
]);
...
...
@@ -58,6 +59,19 @@ class SupplierTransformer
return
$list
;
}
public
function
checkHasQualityAssuranceAgreement
(
$attachment
)
{
if
(
!
$attachment
)
{
return
false
;
}
foreach
(
$attachment
as
$key
=>
$value
)
{
if
(
$value
[
'field_name'
]
==
'quality_assurance_agreement'
)
{
return
true
;
}
}
return
false
;
}
public
function
getContactNum
(
$supplierId
)
{
$model
=
new
SupplierContactModel
();
...
...
@@ -102,7 +116,7 @@ class SupplierTransformer
$supplier
[
'region_name'
]
=
array_get
(
config
(
'fixed.Region'
),
$supplier
[
'region'
]);
$supplier
[
'currency_name'
]
=
array_get
(
config
(
'fixed.Currency'
),
$supplier
[
'currency'
]);
$supplier
[
'supplier_group_name'
]
=
array_get
(
config
(
'fixed.SupplierGroup'
),
$supplier
[
'supplier_group'
]);
$supplier
[
'pay_type_name'
]
=
array_get
(
config
(
'fixed.SupplierPayType'
),
$supplier
[
'pay_type'
]);
$supplier
[
'pay_type_name'
]
=
array_get
(
config
(
'fixed.SupplierPayType'
),
$supplier
[
'pay_type'
]);
$supplier
[
'trading_method_name'
]
=
array_get
(
config
(
'fixed.TradingMethod'
),
$supplier
[
'trading_method'
]);
$supplier
[
'settlement_type_name'
]
=
array_get
(
config
(
'field.SettlementType'
),
$supplier
[
'settlement_type'
]);
$supplier
[
'main_brand_names'
]
=
$this
->
getMainBrandNames
(
$supplier
[
'main_brands'
]);
...
...
@@ -128,7 +142,7 @@ class SupplierTransformer
->
where
(
'type'
,
LogModel
::
UPDATE_OPERATE
)
->
orderBy
(
'id'
,
'desc'
)
->
first
();
$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'
])
:
'无'
)
:
'无'
;
$log
[
'add_time'
])
:
'无'
)
:
'无'
;
$supplier
[
'has_certification_name'
]
=
array_get
(
config
(
'fixed.CertificationStatus'
),
array_get
(
$supplier
,
'has_certification'
,
''
),
''
);
$supplier
[
'sku_tag_name'
]
=
array_get
(
config
(
'field.SkuTag'
),
array_get
(
$supplier
,
'sku_tag'
,
''
),
'无'
);
...
...
resources/views/script/SupplierListScript.blade.php
View file @
cacabeb6
...
...
@@ -88,16 +88,10 @@
}
},
{
field
:
'quality_assurance_agreement'
,
field
:
'
has_
quality_assurance_agreement'
,
title
:
'品质协议'
,
align
:
'center'
,
width
:
80
,
templet
:
function
(
data
)
{
if
(
data
.
attachment
)
{
return
data
.
attachment
.
quality_assurance_agreement
?
'有'
:
'无'
;
}
return
'无'
;
}
},
{
field
:
'contact_num'
,
title
:
'联系人'
,
align
:
'center'
,
width
:
70
,
templet
:
function
(
data
)
{
...
...
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