调整地区

This commit is contained in:
2023-01-29 09:48:54 +08:00
parent e17e9dc5ad
commit 70fd7e70be
11 changed files with 108 additions and 188 deletions

View File

@@ -317,12 +317,24 @@ class User extends Authenticate
* @Date: 2023/1/28 9:32
* @return BelongsToMany
*/
public function areas(): BelongsToMany
// public function areas(): BelongsToMany
// {
// return $this->belongsToMany(
// Area::class,
// (new AreaClerk())->getTable())->using(AreaClerk::class
// );
// }
/**
* Notes: 管理的区域
*
* @Author: 玄尘
* @Date: 2023/1/29 9:37
* @return HasOne
*/
public function area(): HasOne
{
return $this->belongsToMany(
Area::class,
(new AreaClerk())->getTable())->using(AreaClerk::class
);
return $this->hasOne(Area::class);
}