作者 chencheng

kaquana-2

@@ -26,7 +26,7 @@ class Activity extends Backend @@ -26,7 +26,7 @@ class Activity extends Backend
26 { 26 {
27 parent::_initialize(); 27 parent::_initialize();
28 $this->model = new \app\admin\model\verification\Activity; 28 $this->model = new \app\admin\model\verification\Activity;
29 - 29 + $this->view->assign("statusList", $this->model->getStatusList());
30 } 30 }
31 31
32 32
@@ -13,5 +13,8 @@ return [ @@ -13,5 +13,8 @@ return [
13 'Poster' => '海报', 13 'Poster' => '海报',
14 'Phone' => '联系电话', 14 'Phone' => '联系电话',
15 'Store.name' => '门店名称', 15 'Store.name' => '门店名称',
16 - 'Coupon.name' => '卡卷名称' 16 + 'Coupon.name' => '卡卷名称',
  17 + 'Status' => '状态',
  18 + 'Status 0' => '下架',
  19 + 'Status 1' => '上架',
17 ]; 20 ];
@@ -30,7 +30,10 @@ class Activity extends Model @@ -30,7 +30,10 @@ class Activity extends Model
30 30
31 31
32 32
33 - 33 + public function getStatusList()
  34 + {
  35 + return ['0' => __('Status 0'), '1' => __('Status 1')];
  36 + }
34 37
35 38
36 public function getClosetimeTextAttr($value, $data) 39 public function getClosetimeTextAttr($value, $data)
@@ -44,6 +44,17 @@ @@ -44,6 +44,17 @@
44 </div> 44 </div>
45 </div> 45 </div>
46 <div class="form-group"> 46 <div class="form-group">
  47 + <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
  48 + <div class="col-xs-12 col-sm-8">
  49 +
  50 + <div class="radio">
  51 + {foreach name="statusList" item="vo"}
  52 + <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label>
  53 + {/foreach}
  54 + </div>
  55 + </div>
  56 + </div>
  57 + <div class="form-group">
47 <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label> 58 <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
48 <div class="col-xs-12 col-sm-8"> 59 <div class="col-xs-12 col-sm-8">
49 <input id="c-title" class="form-control" name="row[title]" type="text"> 60 <input id="c-title" class="form-control" name="row[title]" type="text">
@@ -34,6 +34,18 @@ @@ -34,6 +34,18 @@
34 </div> 34 </div>
35 </div> 35 </div>
36 <div class="form-group"> 36 <div class="form-group">
  37 + <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
  38 + <div class="col-xs-12 col-sm-8">
  39 +
  40 + <div class="radio">
  41 + {foreach name="statusList" item="vo"}
  42 + <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
  43 + {/foreach}
  44 + </div>
  45 +
  46 + </div>
  47 + </div>
  48 + <div class="form-group">
37 <label class="control-label col-xs-12 col-sm-2">{:__('Poster')}:</label> 49 <label class="control-label col-xs-12 col-sm-2">{:__('Poster')}:</label>
38 <div class="col-xs-12 col-sm-8"> 50 <div class="col-xs-12 col-sm-8">
39 <div class="input-group"> 51 <div class="input-group">
@@ -39,6 +39,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin @@ -39,6 +39,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
39 {field: 'phone', title: __('Phone'), operate: 'LIKE'}, 39 {field: 'phone', title: __('Phone'), operate: 'LIKE'},
40 {field: 'store.name', title: __('Store.name'), operate: 'LIKE'}, 40 {field: 'store.name', title: __('Store.name'), operate: 'LIKE'},
41 {field: 'coupon.name', title: __('Coupon.name'), operate: 'LIKE'}, 41 {field: 'coupon.name', title: __('Coupon.name'), operate: 'LIKE'},
  42 + {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1')}, formatter: Table.api.formatter.status},
42 {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} 43 {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
43 ] 44 ]
44 ] 45 ]