...
|
...
|
@@ -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);
|
...
|
...
|
|