AdminGroup.php 565 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2021 勾股工作室
  4. * @license https://opensource.org/licenses/Apache-2.0
  5. * @link https://www.gougucms.com
  6. */
  7. namespace app\admin\model;
  8. use think\Model;
  9. class AdminGroup extends Model{
  10. protected $table = 'cp_admin_group';
  11. public function department(){
  12. return $this->hasOne('Department', 'id', 'unit_name')
  13. ->bind([
  14. 'd_title' => 'title',
  15. ]);
  16. }
  17. public function admin(){
  18. return $this->hasMany('Admin', 'admin_group_id', 'id');
  19. }
  20. }