refactor: 产品兼容性点赞数量相关
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 4s

This commit is contained in:
2026-08-12 17:03:09 +08:00
parent 9c81113fa7
commit 7f55ea5bad
3 changed files with 4 additions and 2 deletions

View File

@@ -349,7 +349,7 @@ class ProductCompat
'capacity' => '容量',
'frequency' => '频率',
'compatible_models' => '兼容型号',
'praise_count' => '点赞数',
'like_count' => '点赞数',
'sort' => '排序',
'created_at' => '新增时间',
'updated_at' => '更新时间'
@@ -398,7 +398,7 @@ class ProductCompat
'capacity' => $item['capacity'],
'frequency' => $item['frequency'],
'compatible_models' => implode(',', $compat_map[$item['id']] ?? []),
'praise_count' => $item['praise_count'],
'like_count' => $item['like_count'],
'sort' => $item['sort'],
'created_at' => $item['created_at'],
'updated_at' => $item['updated_at']

View File

@@ -28,6 +28,7 @@ class ProductCompatBaseModel extends BaseModel
"series_name" => "string",
"capacity" => "string",
"frequency" => "string",
"like_count" => "int",
"sort" => "int",
"disabled" => "int",
"created_at" => "datetime",

View File

@@ -44,6 +44,7 @@ class CreateProductCompat extends Migrator
->addColumn('series_name', 'string', ['limit' => 128, 'null' => true, 'comment' => '系列'])
->addColumn('capacity', 'string', ['limit' => 32, 'null' => true, 'comment' => '容量'])
->addColumn('frequency', 'string', ['limit' => 128, 'null' => true, 'comment' => '频率'])
->addColumn('like_count', 'integer', ['null' => false, 'default' => 0, 'comment' => '点赞数量'])
->addColumn('sort', 'integer', ['default' => 0, 'comment' => '排序'])
->addColumn('disabled', 'boolean', ['default' => 0, 'comment' => '是否禁用 0:启用 1:禁用'])
->addColumn('created_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])