fix 区域查找父级逻辑
This commit is contained in:
@@ -37,10 +37,20 @@ namespace Ewide.Core
|
|||||||
|
|
||||||
[Comment("排序")]
|
[Comment("排序")]
|
||||||
public int Sort { get; set; }
|
public int Sort { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 父节点就是去掉后面两位
|
/// 父节点就是去掉后面两位
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string ParentCode => LevelType>1?Code[0..(Code.Length-2)]:string.Empty;
|
public string ParentCode => LevelType switch
|
||||||
|
{
|
||||||
|
// 市级 => 没有父级 3302
|
||||||
|
1 => string.Empty,
|
||||||
|
// 区级 => 6位取4位得到市级 330201
|
||||||
|
2 => Code[0..(Code.Length - 2)],
|
||||||
|
// 其他 => 去除后3位得到上级 330201001
|
||||||
|
_ => Code[0..(Code.Length - 3)],
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 多个区域有多个用户绑定自定义数据
|
/// 多个区域有多个用户绑定自定义数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user