Commit e7c4a7ee authored by sugar's avatar sugar

首页样谱

parent b49a60d9
...@@ -55,6 +55,7 @@ class Ethnography extends Backend ...@@ -55,6 +55,7 @@ class Ethnography extends Backend
} }
[$where, $sort, $order, $offset, $limit] = $this->buildparams(); [$where, $sort, $order, $offset, $limit] = $this->buildparams();
$list = $this->model $list = $this->model
->with('surname')
->where($where) ->where($where)
->order($sort, $order) ->order($sort, $order)
->paginate($limit); ->paginate($limit);
......
...@@ -44,6 +44,9 @@ class Ethnography extends Model ...@@ -44,6 +44,9 @@ class Ethnography extends Model
} }
public function surname()
{
return $this->belongsTo('app\admin\model\family\Surname', 'surname_id','id','','left')->setEagerlyType(0);
}
} }
...@@ -31,6 +31,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin ...@@ -31,6 +31,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'title', title: __('Title'), operate: 'LIKE'}, {field: 'title', title: __('Title'), operate: 'LIKE'},
{field: 'class_id', title: __('Class_id')}, {field: 'class_id', title: __('Class_id')},
{field: 'family_id', title: __('Family_id')}, {field: 'family_id', title: __('Family_id')},
{field: 'surname.Surname', title: __('Surname_id')},
{field: 'image_url', title: __('Image_url'), operate: 'LIKE',events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'image_url', title: __('Image_url'), operate: 'LIKE',events: Table.api.events.image, formatter: Table.api.formatter.image},
// {field: 'content', title: __('Content')}, // {field: 'content', title: __('Content')},
{field: 'auth_id', title: __('Auth_id')}, {field: 'auth_id', title: __('Auth_id')},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment