feat : city

This commit is contained in:
2024-11-07 16:42:31 +08:00
parent df421ede3d
commit 0c126ac468
3 changed files with 83 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ use App\Constants\Admin\AuthCode;
use Hyperf\Database\Model\Builder;
use Hyperf\Database\Model\Collection;
use Hyperf\DbConnection\Model\Model;
use Hyperf\Tappable\HigherOrderTapProxy;
/**
* @property int $id
@@ -71,4 +72,13 @@ class AdminSection extends Model
->get([['id','pid','name','status','remark']])
->toArray();
}
/**
* @param int $id
* @return int
*/
public function getCityById(int $id): int
{
return $this->where('id',$id)->value('city_id') ?? 0;
}
}