hasOne(\app\common\model\geo\Province::class, 'province_code', 'province'); } /** * @notes 关联city * @return \think\model\relation\HasOne * @author likeadmin * @date 2024/01/09 18:22 */ public function cityAttr() { return $this->hasOne(\app\common\model\geo\City::class, 'city_code', 'city'); } /** * @notes 关联area * @return \think\model\relation\HasOne * @author likeadmin * @date 2024/01/09 18:22 */ public function areaAttr() { return $this->hasOne(\app\common\model\geo\County::class, 'county_code', 'area'); } /** * @notes 关联street * @return \think\model\relation\HasOne * @author likeadmin * @date 2024/01/09 18:22 */ public function streetAttr() { return $this->hasOne(\app\common\model\geo\Town::class, 'town_code', 'street'); } /** * @notes 关联village * @return \think\model\relation\HasOne * @author likeadmin * @date 2024/01/09 18:22 */ public function villageAttr() { return $this->hasOne(\app\common\model\geo\Village::class, 'village_code', 'village'); } /** * @notes 关联bridge * @return \think\model\relation\HasOne * @author likeadmin * @date 2024/01/09 18:22 */ public function bridgeAttr() { return $this->hasOne(\app\common\model\geo\Group::class, 'id', 'bridge'); } }