正在显示
6 个修改的文件
包含
17 行增加
和
2 行删除
@@ -63,7 +63,7 @@ class Custom extends Backend | @@ -63,7 +63,7 @@ class Custom extends Backend | ||
63 | ->select(); | 63 | ->select(); |
64 | 64 | ||
65 | foreach ($list as $row) { | 65 | foreach ($list as $row) { |
66 | - $row->visible(['id','title','url','image']); | 66 | + $row->visible(['id','title','url','image','weigh']); |
67 | 67 | ||
68 | } | 68 | } |
69 | $list = collection($list)->toArray(); | 69 | $list = collection($list)->toArray(); |
@@ -39,6 +39,12 @@ | @@ -39,6 +39,12 @@ | ||
39 | </div> | 39 | </div> |
40 | </div> | 40 | </div> |
41 | <div class="form-group"> | 41 | <div class="form-group"> |
42 | + <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label> | ||
43 | + <div class="col-xs-12 col-sm-8"> | ||
44 | + <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="0"> | ||
45 | + </div> | ||
46 | + </div> | ||
47 | + <div class="form-group"> | ||
42 | <label class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label> | 48 | <label class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label> |
43 | <div class="col-xs-12 col-sm-8"> | 49 | <div class="col-xs-12 col-sm-8"> |
44 | <input id="c-description" data-rule="required" class="form-control" name="row[description]" type="text" value=""> | 50 | <input id="c-description" data-rule="required" class="form-control" name="row[description]" type="text" value=""> |
@@ -39,6 +39,12 @@ | @@ -39,6 +39,12 @@ | ||
39 | </div> | 39 | </div> |
40 | </div> | 40 | </div> |
41 | <div class="form-group"> | 41 | <div class="form-group"> |
42 | + <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label> | ||
43 | + <div class="col-xs-12 col-sm-8"> | ||
44 | + <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh}"> | ||
45 | + </div> | ||
46 | + </div> | ||
47 | + <div class="form-group"> | ||
42 | <label class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label> | 48 | <label class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label> |
43 | <div class="col-xs-12 col-sm-8"> | 49 | <div class="col-xs-12 col-sm-8"> |
44 | <input id="c-description" data-rule="required" class="form-control" name="row[description]" type="text" value="{$row.description}"> | 50 | <input id="c-description" data-rule="required" class="form-control" name="row[description]" type="text" value="{$row.description}"> |
@@ -37,7 +37,8 @@ class Index extends Frontend | @@ -37,7 +37,8 @@ class Index extends Frontend | ||
37 | { | 37 | { |
38 | //普通新闻列表 | 38 | //普通新闻列表 |
39 | $custom = Db::name('custom') | 39 | $custom = Db::name('custom') |
40 | - ->field('id,url,image') | 40 | + ->field('id,url,image,weigh') |
41 | + ->order('weigh','desc') | ||
41 | ->select(); | 42 | ->select(); |
42 | $count = ceil(count($custom)/$this->group); | 43 | $count = ceil(count($custom)/$this->group); |
43 | $list = 0; | 44 | $list = 0; |
@@ -28,6 +28,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | @@ -28,6 +28,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | ||
28 | {field: 'title', title: __('Title')}, | 28 | {field: 'title', title: __('Title')}, |
29 | {field: 'image', title: __('Image'), events: Table.api.events.image, formatter: Table.api.formatter.image}, | 29 | {field: 'image', title: __('Image'), events: Table.api.events.image, formatter: Table.api.formatter.image}, |
30 | {field: 'url', title: __('Url')}, | 30 | {field: 'url', title: __('Url')}, |
31 | + {field: 'weigh', title: __('Weigh')}, | ||
31 | {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} | 32 | {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} |
32 | ] | 33 | ] |
33 | ] | 34 | ] |
-
请 注册 或 登录 后发表评论