标签关系
This commit is contained in:
@@ -96,4 +96,13 @@ class Customer extends Model
|
||||
|
||||
return $customer;
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户的标签
|
||||
*/
|
||||
public function tags()
|
||||
{
|
||||
return $this->belongsToMany(Tag::class, 'customer_tag', 'customer_id', 'tag_id')
|
||||
->withTimestamps(); // 如果需要记录关联时间
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user