xieruidong il y a 2 ans
Parent
commit
fd35d575f0

+ 1 - 1
application/admin/controller/Coupon.php

@@ -22,7 +22,7 @@ class Coupon extends Backend
     {
         parent::_initialize();
         $this->model = new \app\admin\model\Coupon;
-
+        $this->assign('types',\app\admin\model\Coupon::getTypes());
     }
 
     public function import()

+ 3 - 0
application/admin/view/coupon/index.html

@@ -33,3 +33,6 @@
         </div>
     </div>
 </div>
+<script>
+    var types={:json_encode($types)}
+</script>

+ 6 - 5
public/assets/js/backend/coupon.js

@@ -26,13 +26,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     [
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
-                        {field: 'type', title: __('Type')},
-                        {field: 'amount', title: __('Amount'), operate:'BETWEEN'},
-                        {field: 'mount_full', title: __('Mount_full'), operate:'BETWEEN'},
+                        {field: 'type', title: __('Type'),searchList:types,formatter: Table.api.formatter.label},
+                        {field: 'amount', title: __('金额'), operate:'BETWEEN'},
+                        {field: 'mount_full', title: __('满减金额'), operate:'BETWEEN'},
                         {field: 'num', title: __('Num')},
                         {field: 'num_send', title: __('Num_send')},
-                        {field: 'time_start', title: __('Time_start'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
-                        {field: 'time_end', title: __('Time_end'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
+                        {field: 'time_start', title: __('开始时间'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
+                        {field: 'time_end', title: __('过期时间'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
+                        {field: 'create_time', title: __('创建时间'), operate:'RANGE', addclass:'datetimerange', autocomplete:false,formatter: Table.api.formatter.datetime},
                         {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                     ]
                 ]