作者 开飞机的舒克

后台功能优化

<?php
return [
'Item_id' => '项目id',
'Images' => '图片',
'Details' => '详情',
'Is_sift' => '是否为精选',
'Is_sift 0' => '否',
'Is_sift 1' => '是',
'Createtime' => '创建时间',
'Updatetime' => '更新时间',
'Item.title' => '名称'
];
... ... @@ -2,7 +2,7 @@
return [
'Campus_id' => '所属校区',
'Ronda_id' => '场次',
'Ronda_id' => '所属场次',
'Title' => '名称',
'Radar_id' => '所属维度',
'User_id' => '所属老师',
... ...
<?php
return [
'Id' => '积分',
'Campus_id' => '校区id',
'Item_id' => '项目id',
'Study_id' => '学生id',
'Team_id' => '战队id',
'Score' => '积分',
'Memo' => '备注',
'Createtime' => '创建时间',
'Updatetime' => '更新时间'
];
... ... @@ -25,15 +25,14 @@ class Item extends Model
// 追加属性
protected $append = [
'campus_text'
];
public function getCampusTextAttr($value,$data){
$cid = db('ronda')->where('id',$data['ronda_id'])->value('campus_id');
$list = db('campus')->where('id',$cid)->value('title');
return $list;
}
... ... @@ -54,7 +53,6 @@ class Item extends Model
return $this->belongsTo('Radar', 'radar_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function campus()
{
return $this->belongsTo('Campus', 'campus_id', 'id', [], 'LEFT')->setEagerlyType(0);
... ...
... ... @@ -7,15 +7,15 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Ronda_id')}:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('Campus_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-ronda_id" data-rule="required" data-source="ronda/index" class="form-control selectpage" data-field="title" name="row[ronda_id]" type="text" value="">
<input id="c-campus_id" data-rule="required" data-source="campus/index" class="form-control selectpage" data-field="title" name="row[campus_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Campus_id')}:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('Ronda_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-campus_id" data-rule="required" data-source="campus/index" class="form-control selectpage" data-field="title" name="row[campus_id]" type="text" value="">
<input id="c-ronda_id" data-rule="required" data-source="ronda/index" class="form-control selectpage" data-field="title" name="row[ronda_id]" type="text" value="">
</div>
</div>
<div class="form-group">
... ...
... ... @@ -7,15 +7,15 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Ronda_id')}:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('Campus_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-ronda_id" data-rule="required" data-source="ronda/index" class="form-control selectpage" name="row[ronda_id]" data-field="title" type="text" value="{$row.ronda_id|htmlentities}">
<input id="c-campus_id" data-rule="required" data-source="campus/index" class="form-control selectpage" name="row[campus_id]" data-field="title" type="text" value="{$row.campus_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Campus_id')}:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('Ronda_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-campus_id" data-rule="required" data-source="campus/index" class="form-control selectpage" name="row[campus_id]" data-field="title" type="text" value="{$row.campus_id|htmlentities}">
<input id="c-ronda_id" data-rule="required" data-source="ronda/index" class="form-control selectpage" name="row[ronda_id]" data-field="title" type="text" value="{$row.ronda_id|htmlentities}">
</div>
</div>
<div class="form-group">
... ...