作者 魏强

Merge branch 'master' of http://114.215.101.231:8099/root/liepin

@@ -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();
@@ -6,4 +6,5 @@ return [ @@ -6,4 +6,5 @@ return [
6 'Url' => '链接', 6 'Url' => '链接',
7 'Image' => '图片', 7 'Image' => '图片',
8 'Description' => '描述', 8 'Description' => '描述',
  9 + 'Weigh' => '权重',
9 ]; 10 ];
@@ -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 ]