diff --git a/app/data/model/BaseUserDiscount.php b/app/data/model/BaseUserDiscount.php
index a2069d4c4..3b43b9225 100644
--- a/app/data/model/BaseUserDiscount.php
+++ b/app/data/model/BaseUserDiscount.php
@@ -18,7 +18,7 @@ class BaseUserDiscount extends Model
*/
public function getItemsAttr($value)
{
- return empty($value) ? json_decode($value, true) : $value;
+ return empty($value) ? $value : json_decode($value, true);
}
/**
diff --git a/app/data/view/base/discount/index.html b/app/data/view/base/discount/index.html
index 6ef0f8713..7e58781bd 100644
--- a/app/data/view/base/discount/index.html
+++ b/app/data/view/base/discount/index.html
@@ -2,7 +2,7 @@
{block name="button"}
-
+
{/block}
@@ -30,13 +30,19 @@
sort: {field: 'sort desc,id', type: 'desc'},
where: {type: '{$type|default="index"}'},
cols: [[
- // {checkbox: true, fixed: true},
{field: 'sort', title: '排序权重', align: 'center', width: 100, sort: true, templet: '#SortInputTpl'},
{field: 'id', title: 'ID', align: "center", width: 80},
{field: 'name', title: '折扣名称', align: 'left', minWidth: 140},
- {field: 'status', title: '状态', align: 'center', minWidth: 110, templet: '#StatusSwitchTpl'},
+ {
+ field: 'items', title: '折扣方案', align: 'left', minWidth: 200, templet: function (d) {
+ return (d.html = ''), d.items.forEach(function (item) {
+ d.html += laytpl('VIP{{d.level}} 折扣 {{d.discount}}%').render(item);
+ }), d.html;
+ }
+ },
+ {field: 'status', title: '状态', align: 'center', width: 110, templet: '#StatusSwitchTpl'},
{field: 'create_at', title: '创建时间', align: 'center', minWidth: 170, sort: true},
- {toolbar: '#toolbar', title: '操作面板', align: 'center', minWidth: 160, fixed: 'right'},
+ {toolbar: '#toolbar', title: '操作面板', align: 'center', minWidth: 80, fixed: 'right'},
]]
});