<?php namespace app\model; use think\Model; class Ad extends Model { protected $table = 'ad_ga_ads'; protected $primaryKey = 'id'; protected $autoWriteTimestamp = true; public function adGroup() { return $this->belongsTo(AdGroup::class, 'ad_group_id', 'id'); } }