正在显示
7 个修改的文件
包含
56 行增加
和
6 行删除
@@ -23,6 +23,7 @@ class Litestorenews extends Backend | @@ -23,6 +23,7 @@ class Litestorenews extends Backend | ||
23 | parent::_initialize(); | 23 | parent::_initialize(); |
24 | $this->model = new \app\admin\model\litestore\Litestorenews; | 24 | $this->model = new \app\admin\model\litestore\Litestorenews; |
25 | $this->view->assign("statusList", $this->model->getStatusList()); | 25 | $this->view->assign("statusList", $this->model->getStatusList()); |
26 | + $this->view->assign("typeList", $this->model->getTypeList()); | ||
26 | } | 27 | } |
27 | 28 | ||
28 | /** | 29 | /** |
@@ -7,5 +7,9 @@ return [ | @@ -7,5 +7,9 @@ return [ | ||
7 | 'Content' => '内容', | 7 | 'Content' => '内容', |
8 | 'Createtime' => '添加时间', | 8 | 'Createtime' => '添加时间', |
9 | 'Updatetime' => '更新时间', | 9 | 'Updatetime' => '更新时间', |
10 | - 'Status' => '状态' | 10 | + 'Status' => '状态', |
11 | + 'Type' => '类型', | ||
12 | + 'Type 1' => '邀请有奖', | ||
13 | + 'Type 2' => '商品详情', | ||
14 | + 'Goods_id' => '商品选择', | ||
11 | ]; | 15 | ]; |
@@ -26,7 +26,12 @@ class Litestorenews extends Model | @@ -26,7 +26,12 @@ class Litestorenews extends Model | ||
26 | public function getStatusList() | 26 | public function getStatusList() |
27 | { | 27 | { |
28 | return ['normal' => __('Normal'),'hidden' => __('Hidden')]; | 28 | return ['normal' => __('Normal'),'hidden' => __('Hidden')]; |
29 | - } | 29 | + } |
30 | + | ||
31 | + public function getTypeList() | ||
32 | + { | ||
33 | + return ['1' => __('Type 1'),'2' => __('Type 2')]; | ||
34 | + } | ||
30 | 35 | ||
31 | 36 | ||
32 | public function getStatusTextAttr($value, $data) | 37 | public function getStatusTextAttr($value, $data) |
@@ -6,6 +6,12 @@ | @@ -6,6 +6,12 @@ | ||
6 | <!-- </div>--> | 6 | <!-- </div>--> |
7 | <!-- </div>--> | 7 | <!-- </div>--> |
8 | <div class="form-group"> | 8 | <div class="form-group"> |
9 | + <label class="control-label col-xs-12 col-sm-2">{:__('Goods_id')}:</label> | ||
10 | + <div class="col-xs-12 col-sm-8"> | ||
11 | + <input id="c-title" data-source="litestore/Litestoregoods/index" data-field="goods_name" class="form-control selectpage" name="row[goods_id]" type="text" value=""> | ||
12 | + </div> | ||
13 | + </div> | ||
14 | + <div class="form-group"> | ||
9 | <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label> | 15 | <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label> |
10 | <div class="col-xs-12 col-sm-8"> | 16 | <div class="col-xs-12 col-sm-8"> |
11 | <div class="input-group"> | 17 | <div class="input-group"> |
@@ -26,12 +32,24 @@ | @@ -26,12 +32,24 @@ | ||
26 | <!-- </div>--> | 32 | <!-- </div>--> |
27 | <!-- </div>--> | 33 | <!-- </div>--> |
28 | <div class="form-group"> | 34 | <div class="form-group"> |
29 | - <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label> | 35 | + <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label> |
30 | <div class="col-xs-12 col-sm-8"> | 36 | <div class="col-xs-12 col-sm-8"> |
31 | 37 | ||
32 | <div class="radio"> | 38 | <div class="radio"> |
39 | + {foreach name="typeList" item="vo"} | ||
40 | + <label for="row[type]-{$key}"><input id="row[type]-{$key}" name="row[type]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> | ||
41 | + {/foreach} | ||
42 | + </div> | ||
43 | + | ||
44 | + </div> | ||
45 | + </div> | ||
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"> | ||
33 | {foreach name="statusList" item="vo"} | 51 | {foreach name="statusList" item="vo"} |
34 | - <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="normal"}checked{/in} /> {$vo}</label> | 52 | + <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="normal"}checked{/in} /> {$vo}</label> |
35 | {/foreach} | 53 | {/foreach} |
36 | </div> | 54 | </div> |
37 | 55 |
@@ -7,6 +7,12 @@ | @@ -7,6 +7,12 @@ | ||
7 | <!-- </div>--> | 7 | <!-- </div>--> |
8 | <!-- </div>--> | 8 | <!-- </div>--> |
9 | <div class="form-group"> | 9 | <div class="form-group"> |
10 | + <label class="control-label col-xs-12 col-sm-2">{:__('Goods_id')}:</label> | ||
11 | + <div class="col-xs-12 col-sm-8"> | ||
12 | + <input id="c-title" data-source="litestore/Litestoregoods/index" data-field="goods_name" class="form-control selectpage" name="row[goods_id]" type="text" value="{$row.goods_id}"> | ||
13 | + </div> | ||
14 | + </div> | ||
15 | + <div class="form-group"> | ||
10 | <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label> | 16 | <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label> |
11 | <div class="col-xs-12 col-sm-8"> | 17 | <div class="col-xs-12 col-sm-8"> |
12 | <div class="input-group"> | 18 | <div class="input-group"> |
@@ -27,6 +33,18 @@ | @@ -27,6 +33,18 @@ | ||
27 | <!-- </div>--> | 33 | <!-- </div>--> |
28 | <!-- </div>--> | 34 | <!-- </div>--> |
29 | <div class="form-group"> | 35 | <div class="form-group"> |
36 | + <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label> | ||
37 | + <div class="col-xs-12 col-sm-8"> | ||
38 | + | ||
39 | + <div class="radio"> | ||
40 | + {foreach name="typeList" item="vo"} | ||
41 | + <label for="row[type]-{$key}"><input id="row[type]-{$key}" name="row[type]" type="radio" value="{$key}" {in name="key" value="$row.type"}checked{/in} /> {$vo}</label> | ||
42 | + {/foreach} | ||
43 | + </div> | ||
44 | + | ||
45 | + </div> | ||
46 | + </div> | ||
47 | + <div class="form-group"> | ||
30 | <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label> | 48 | <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label> |
31 | <div class="col-xs-12 col-sm-8"> | 49 | <div class="col-xs-12 col-sm-8"> |
32 | 50 |
@@ -25,15 +25,18 @@ class Index extends Api | @@ -25,15 +25,18 @@ class Index extends Api | ||
25 | 'code':'1', | 25 | 'code':'1', |
26 | 'msg':'返回成功' | 26 | 'msg':'返回成功' |
27 | 'data':'轮播图数组' | 27 | 'data':'轮播图数组' |
28 | + 'type':'类型:1=邀请有奖,2=商品详情' | ||
29 | + 'goods_id':'商品id' | ||
30 | + 'image':'轮播图' | ||
28 | }) | 31 | }) |
29 | */ | 32 | */ |
30 | public function banner() | 33 | public function banner() |
31 | { | 34 | { |
32 | 35 | ||
33 | $model = new News(); | 36 | $model = new News(); |
34 | - $list = $model->where('status','normal')->column('image'); | 37 | + $list = $model->where('status','normal')->field('type,goods_id,image')->select(); |
35 | foreach ($list as $key => &$value){ | 38 | foreach ($list as $key => &$value){ |
36 | - $value = cdnurl($value,true); | 39 | + $value['image'] = cdnurl($value['image'],true); |
37 | } | 40 | } |
38 | $this->success('banner',$list); | 41 | $this->success('banner',$list); |
39 | } | 42 | } |
@@ -32,6 +32,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | @@ -32,6 +32,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | ||
32 | {field: 'image', title: __('Image'), formatter: Table.api.formatter.image}, | 32 | {field: 'image', title: __('Image'), formatter: Table.api.formatter.image}, |
33 | {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, | 33 | {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, |
34 | {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, | 34 | {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, |
35 | + {field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.status}, | ||
35 | {field: 'status', title: __('Status'), searchList: {"normal":__('Normal'),"hidden":__('Hidden')}, formatter: Table.api.formatter.status}, | 36 | {field: 'status', title: __('Status'), searchList: {"normal":__('Normal'),"hidden":__('Hidden')}, formatter: Table.api.formatter.status}, |
36 | {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} | 37 | {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} |
37 | ] | 38 | ] |
-
请 注册 或 登录 后发表评论