blog/app/model/Department.php
2024-06-08 15:54:41 +08:00

18 lines
435 B
PHP

<?php
namespace app\model;
use think\Model;
class Department extends Model
{
protected $table = 'eb_department';
protected $primaryKey = 'id';
public $timestamps = false;
public function allList():array
{
$info = $this->field('id, name, parent_id')->select()->toArray();
if ($info) return show(true, '获取成功', ['rows' => $info]);
return show(false, '暂无查询到数据');
}
}