作者 何书鹏
1 个管道 的构建 通过 耗费 1 秒

banner修改

... ... @@ -51,12 +51,12 @@ class Litestorenews extends Backend
if ($this->dataLimit && $this->dataLimitFieldAutoFill) {
$params[$this->dataLimitField] = $this->auth->id;
}
if($params['type'] == 1 && empty($params['goods_id'])) {
$this->error('请选择商品');
}
if($params['type'] == 2 && empty($params['href'])) {
$this->error('请填写链接');
}
if($params['type'] == 3 && empty($params['goods_id'])) {
$this->error('请选择商品');
}
$result = false;
Db::startTrans();
try {
... ... @@ -108,12 +108,12 @@ class Litestorenews extends Backend
$params = $this->request->post("row/a");
if ($params) {
$params = $this->preExcludeFields($params);
if($params['type'] == 1 && empty($params['goods_id'])) {
$this->error('请选择商品');
}
if($params['type'] == 2 && empty($params['href'])) {
$this->error('请填写链接');
}
if($params['type'] == 3 && empty($params['goods_id'])) {
$this->error('请选择商品');
}
$result = false;
Db::startTrans();
try {
... ...
<?php
return [
'Id' => 'id',
'Image' => '图片',
'Url' => '跳转链接',
'Typeswitch' => '是否跳转',
'Weigh' => '排序',
'Createtime' => '创建时间',
'Updatetime' => '修改时间'
... ...
... ... @@ -15,6 +15,18 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-url" class="form-control" name="row[url]" type="text">
</div>
</div>
<!--<div class="form-group">-->
<!--<label class="control-label col-xs-12 col-sm-2">{:__('Typeswitch')}:</label>-->
<!--<div class="col-xs-12 col-sm-8">-->
<!--<input id="c-typeswitch" class="form-control" name="row[typeswitch]" type="number">-->
<!--</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">
... ...
... ... @@ -15,6 +15,18 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-url" class="form-control" name="row[url]" type="text" value="{$row.url|htmlentities}">
</div>
</div>
<!-- <div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Typeswitch')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-typeswitch" class="form-control" name="row[typeswitch]" type="number" value="{$row.typeswitch|htmlentities}">
</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|htmlentities}">
... ...
... ... @@ -64,6 +64,8 @@ class Hot extends Api
"data": [{
"id": 1,
"image": "http://community.qiniu.brotop.cn/uploads/20200910/0afb1f6a54b2ca30a2fa3f3f6cafbd3f.jpg",
"url"://跳转地址
"typeswitch"://开关0关1开
"weigh": 1,
"createtime": "2020-09-10 11:47:28"
}]
... ...
... ... @@ -26,6 +26,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'image', title: __('Image'), events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'url', title: __('Url'), formatter: Table.api.formatter.url},
{field: 'typeswitch', title: __('是否开启跳转'), table: table, formatter: Table.api.formatter.toggle},
{field: 'weigh', title: __('Weigh')},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
... ...