<?php

namespace app\model;

use think\Model;

class Labels extends Model
{
    // 设置当前模型对应的完整数据表名称
    protected $table = 'labels';
    protected $db;

    function __construct()
    {
        $this->db = Db($this->table);
    }

    public function getLabels()
    {
        return $data = $this->db
            ->field("id,name")
            ->select();
    }
}
