diff --git a/plugs/think-plugs-ticket/src/controller/Dept.php b/plugs/think-plugs-ticket/src/controller/Dept.php index 9a53836..70b4a51 100644 --- a/plugs/think-plugs-ticket/src/controller/Dept.php +++ b/plugs/think-plugs-ticket/src/controller/Dept.php @@ -5,6 +5,7 @@ namespace plugin\ticket\controller; use plugin\ticket\model\TicketDept; use think\admin\Controller; use think\admin\helper\QueryHelper; +use think\admin\model\SystemUser; class Dept extends Controller { @@ -14,19 +15,21 @@ class Dept extends Controller TicketDept::mQuery()->layTable(function () { }, function (QueryHelper $query) { - $query->like('name')->equal('status'); + $query->like('name')->with('fz_user')->equal('status'); }); } public function add() { $this->title = '添加部门'; + $this->users = SystemUser::query()->where(['status' => 1])->order('sort desc,id desc')->select(); TicketDept::mForm('form'); } public function edit() { $this->title = '编辑部门'; + $this->users = SystemUser::query()->where(['status' => 1])->order('sort desc,id desc')->select(); TicketDept::mForm('form'); } diff --git a/plugs/think-plugs-ticket/src/model/TicketDept.php b/plugs/think-plugs-ticket/src/model/TicketDept.php index 0d46999..66b59cf 100644 --- a/plugs/think-plugs-ticket/src/model/TicketDept.php +++ b/plugs/think-plugs-ticket/src/model/TicketDept.php @@ -3,6 +3,7 @@ namespace plugin\ticket\model; use think\admin\Model; +use think\admin\model\SystemUser; class TicketDept extends Model { @@ -10,4 +11,9 @@ class TicketDept extends Model { $query->where('status', '=', 1); } + + public function fz_user() + { + return $this->hasOne(SystemUser::class, 'id', 'fz_user_id'); + } } \ No newline at end of file diff --git a/plugs/think-plugs-ticket/src/view/dept/form.html b/plugs/think-plugs-ticket/src/view/dept/form.html index bad18e6..cdf31d4 100644 --- a/plugs/think-plugs-ticket/src/view/dept/form.html +++ b/plugs/think-plugs-ticket/src/view/dept/form.html @@ -1,21 +1,23 @@