作者 开飞机的舒克

后台修改

... ... @@ -34,4 +34,38 @@ class Banner extends Backend
*/
/**
* 查看
*/
public function index()
{
//当前是否为关联查询
$this->relationSearch = false;
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax()) {
//如果发送的来源是Selectpage,则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->where($where)
->order($sort, $order)
->paginate($limit);
foreach ($list as $row) {
$row->visible(['id','title','images','is_url','url','details']);
}
$result = array("total" => $list->total(), "rows" => $list->items());
return json($result);
}
return $this->view->fetch();
}
}
... ...
... ... @@ -7,6 +7,7 @@ return [
'Is_url 0' => '否',
'Is_url 1' => '是',
'Url' => '跳转地址',
'Details' => '轮播图内容',
'Createtime' => '创建时间',
'Updatetime' => '修改时间'
];
... ...
... ... @@ -7,6 +7,11 @@ use think\Model;
class Banner extends Model
{
// 表名
protected $name = 'banner';
... ...
... ... @@ -38,6 +38,12 @@
<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">{:__('Details')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-details" class="form-control " rows="5" name="row[details]" cols="50"></textarea>
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
... ...
... ... @@ -38,6 +38,12 @@
<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">{:__('Details')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-details" class="form-control " rows="5" name="row[details]" cols="50">{$row.details|htmlentities}</textarea>
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
... ...
... ... @@ -102,7 +102,7 @@ class Index extends Api
if (!$data){
$this->error('当前还没有轮播图',['status'=>2]);
}
$this->success('获取轮播图成功', [$data, 'status' => 1]);
$this->success('获取轮播图成功', $data);
}
/**
... ...
... ... @@ -4308,7 +4308,7 @@
</div>
<div class="col-md-6" align="right">
Generated on 2023-03-10 15:16:00 <a href="./" target="_blank">校园活动</a>
Generated on 2023-03-10 16:13:38 <a href="./" target="_blank">校园活动</a>
</div>
</div>
... ...
... ... @@ -94,9 +94,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'school.title', title: __('School.title'), operate: 'LIKE'},
{field: 'sno', title: __('Sno'), operate: 'LIKE'},
// {field: 'team_id', title: __('Team_id')},
{field: 'earn_score', title: __('Earn_score'), operate:false},
{field: 'earn_score', title: __('Earn_score'),operate:false},
{field: 'unique', title: __('Unique'), operate:false},
{field: 'barcode', title: __('Barcode'), operate:false},
{field: 'barcode', title: __('Barcode'),events: Table.api.events.image, formatter: Table.api.formatter.image, operate:false},
// {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
// {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
... ... @@ -106,8 +106,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
title: __('生成条形码'),
classname: 'btn btn-xs btn-primary btn-ajax',
icon: 'fa fa-qrcode',
url: 'study/barcode?ids',
confirm: '确认生成新的条形码吗',
url: function(ids){
var x = JSON.stringify(ids);
var s = ids.id;
return 'study/barcode?ids='+s;
},
confirm: '确认生成新的条形码',
success: function (data, ret) {
return true;
},
... ...