作者 魏强

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

... ... @@ -63,7 +63,7 @@ class Custom extends Backend
->select();
foreach ($list as $row) {
$row->visible(['id','title','url','image']);
$row->visible(['id','title','url','image','weigh']);
}
$list = collection($list)->toArray();
... ...
... ... @@ -6,4 +6,5 @@ return [
'Url' => '链接',
'Image' => '图片',
'Description' => '描述',
'Weigh' => '权重',
];
... ...
... ... @@ -39,6 +39,12 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="0">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-description" data-rule="required" class="form-control" name="row[description]" type="text" value="">
... ...
... ... @@ -39,6 +39,12 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
<div class="col-xs-12 col-sm-8">
<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
{
//普通新闻列表
$custom = Db::name('custom')
->field('id,url,image')
->field('id,url,image,weigh')
->order('weigh','desc')
->select();
$count = ceil(count($custom)/$this->group);
$list = 0;
... ...
... ... @@ -28,6 +28,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'title', title: __('Title')},
{field: 'image', title: __('Image'), events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'url', title: __('Url')},
{field: 'weigh', title: __('Weigh')},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]
... ...