feature: kpi item template
This commit is contained in:
parent
5c9edcfd4e
commit
eb531334f6
|
|
@ -101,6 +101,7 @@ class Item extends Backend
|
|||
$list = $this->model
|
||||
->where($where)
|
||||
->with('admin')
|
||||
->with('authgroup')
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
$result = ['total' => $list->total(), 'rows' => $list->items()];
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ class Template extends Backend
|
|||
->where($where)
|
||||
->with('kpiitem')
|
||||
->with('admin')
|
||||
->with('authgroup')
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
return [
|
||||
'Id' => 'ID',
|
||||
'Admin_id' => '创建人id',
|
||||
'Admin.nickname' => '昵称',
|
||||
'Admin.nickname' => '创建人',
|
||||
'AuthGroup.name' => '角色',
|
||||
'Name' => '名称',
|
||||
'Desc' => '描述',
|
||||
'Target_value' => '目标值',
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
return [
|
||||
'Id' => 'ID',
|
||||
'Admin_id' => '创建人id',
|
||||
'Admin.nickname' => '昵称',
|
||||
'Admin.nickname' => '创建人',
|
||||
'AuthGroup.name' => '角色',
|
||||
'Name' => '名称',
|
||||
'Desc' => '描述',
|
||||
'Create_time' => '创建时间',
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace app\admin\model\kpi;
|
||||
|
||||
use app\admin\model\Admin;
|
||||
use app\admin\model\AuthGroup;
|
||||
use think\Model;
|
||||
|
||||
|
||||
|
|
@ -45,7 +46,13 @@ class Item extends Model
|
|||
|
||||
public function admin()
|
||||
{
|
||||
return $this->belongsTo(Admin::class, 'admin_id')->setEagerlyType(0);
|
||||
return $this->belongsTo(Admin::class, 'admin_id')->setEagerlyType(1);
|
||||
}
|
||||
|
||||
|
||||
public function authgroup()
|
||||
{
|
||||
return $this->belongsTo(AuthGroup::class, 'group_id')->setEagerlyType(1);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
namespace app\admin\model\kpi;
|
||||
|
||||
use app\admin\model\Admin;
|
||||
use app\admin\model\AuthGroup;
|
||||
use think\Model;
|
||||
|
||||
|
||||
|
|
@ -42,8 +43,12 @@ class Template extends Model
|
|||
|
||||
public function admin()
|
||||
{
|
||||
return $this->belongsTo(Admin::class, 'admin_id')->setEagerlyType(0);
|
||||
return $this->belongsTo(Admin::class, 'admin_id')->setEagerlyType(1);
|
||||
}
|
||||
|
||||
public function authgroup()
|
||||
{
|
||||
return $this->belongsTo(AuthGroup::class, 'group_id')->setEagerlyType(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,6 @@ class Schedule extends Model
|
|||
|
||||
public function admin()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\Admin', 'exec_admin_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
return $this->belongsTo('app\admin\model\Admin', 'exec_admin_id', 'id', [], 'LEFT')->setEagerlyType(1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,6 +62,6 @@ class Task extends Model
|
|||
|
||||
public function admin()
|
||||
{
|
||||
return $this->belongsTo('app\admin\model\Admin', 'exec_admin_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
return $this->belongsTo('app\admin\model\Admin', 'exec_admin_id', 'id', [], 'LEFT')->setEagerlyType(1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'},
|
||||
{field: 'authgroup.name', title: __('AuthGroup.name'), operate: 'LIKE'},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'desc', title: __('Desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'target_value', title: __('Target_value')},
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'admin.nickname', title: __('Admin.nickname'), operate: 'LIKE'},
|
||||
{field: 'authgroup.name', title: __('AuthGroup.name'), operate: 'LIKE'},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'desc', title: __('Desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user