refactor: 更新产品接口添加sku处理逻辑

This commit is contained in:
2025-02-13 11:57:54 +08:00
parent dda86c4a06
commit 0aded19473
6 changed files with 205 additions and 64 deletions

View File

@@ -30,7 +30,7 @@ class CreateProductSkuAttr extends Migrator
$table = $this->table('product_sku_attr', ['id' => false,'engine' => 'InnoDB', 'comment' => '产品SKU属性表']);
$table->addColumn('sku_id', 'integer', ['signed' => false, 'null' => false, 'comment' => '产品SKU ID'])
->addColumn('attr_id', 'integer', ['signed' => false, 'null' => false, 'comment' => '属性ID'])
->addColumn('prop_id', 'integer', ['signed' => false, 'null' => false, 'comment' => '属性特征ID'])
->addColumn('attr_value', 'string', ['limit' => 64, 'null' => false, 'default' => '', 'comment' => '属性'])
->addForeignKey('sku_id', 'product_sku', 'id', ['update' => 'CASCADE', 'delete' => 'CASCADE'])
->create();
}