hasOne("app\\{$module}\\model\\UploadFile", 'file_id', 'logo_image_id'); } /** * 地区名称 * @param $value * @param $data * @return array */ public function getRegionAttr($value, $data) { return [ 'province' => RegionModel::getNameById($data['province_id']), 'city' => RegionModel::getNameById($data['city_id']), 'region' => $data['region_id'] == 0 ? '' : RegionModel::getNameById($data['region_id']), ]; } /** * 门店详情 * @param $shop_id * @return static|null * @throws \think\exception\DbException */ public static function detail($shop_id) { return static::get($shop_id, ['logo']); } }