update:去掉父节点
This commit is contained in:
@@ -34,13 +34,12 @@ namespace Ewide.Core.Entity
|
|||||||
[Required]
|
[Required]
|
||||||
public int LevelType { get; set; }
|
public int LevelType { get; set; }
|
||||||
|
|
||||||
[Comment("父级区域代码")]
|
|
||||||
[MaxLength(10)]
|
|
||||||
public string ParentCode { get; set; }
|
|
||||||
|
|
||||||
[Comment("排序")]
|
[Comment("排序")]
|
||||||
public int Sort { get; set; }
|
public int Sort { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 父节点就是去掉后面两位
|
||||||
|
/// </summary>
|
||||||
|
public string ParentCode => LevelType>1?Code[0..(Code.Length-2)]:string.Empty;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 多个区域有多个用户绑定自定义数据
|
/// 多个区域有多个用户绑定自定义数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
6986
Api/Ewide.Database.Migrations/Migrations/20210427093101_removeAreaNumberParent.Designer.cs
generated
Normal file
6986
Api/Ewide.Database.Migrations/Migrations/20210427093101_removeAreaNumberParent.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,25 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace Ewide.Database.Migrations.Migrations
|
||||||
|
{
|
||||||
|
public partial class removeAreaNumberParent : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "ParentCode",
|
||||||
|
table: "ewide_area_number");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "ParentCode",
|
||||||
|
table: "ewide_area_number",
|
||||||
|
type: "varchar(10) CHARACTER SET utf8mb4",
|
||||||
|
maxLength: 10,
|
||||||
|
nullable: true,
|
||||||
|
comment: "父级区域代码");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -102,11 +102,6 @@ namespace Ewide.Database.Migrations.Migrations
|
|||||||
.HasColumnType("longtext CHARACTER SET utf8mb4")
|
.HasColumnType("longtext CHARACTER SET utf8mb4")
|
||||||
.HasComment("备注");
|
.HasComment("备注");
|
||||||
|
|
||||||
b.Property<string>("ParentCode")
|
|
||||||
.HasMaxLength(10)
|
|
||||||
.HasColumnType("varchar(10) CHARACTER SET utf8mb4")
|
|
||||||
.HasComment("父级区域代码");
|
|
||||||
|
|
||||||
b.Property<string>("ShowCode")
|
b.Property<string>("ShowCode")
|
||||||
.HasMaxLength(10)
|
.HasMaxLength(10)
|
||||||
.HasColumnType("varchar(10) CHARACTER SET utf8mb4")
|
.HasColumnType("varchar(10) CHARACTER SET utf8mb4")
|
||||||
|
|||||||
Reference in New Issue
Block a user