<?php

namespace app\model\project;

use think\Model;

class AdvertCate extends Model
{

    protected $name = 'advert_cate';

    protected $autoWriteTimestamp = true;

    protected $createTime = 'create_time';


    public function getAdvertList()
    {
        return $this->hasMany(Advert::class, 'p_id', 'id')
            ->field('id,name,type,url,p_id,url,cover_img_id')
            ->order('sort desc');
    }

}