Update
parent
de5a97ac3a
commit
5d1f06ed6d
|
|
@ -20,6 +20,7 @@ class ProductSku extends Model
|
|||
'cost_price' => Price::class,
|
||||
'user_price' => Price::class,
|
||||
'attrs' => JsonArray::class,
|
||||
'is_sell' => 'bool',
|
||||
'specs' => 'json',
|
||||
'online_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,6 @@ class ProductSpu extends Model
|
|||
'cost_price' => Price::class,
|
||||
'user_price' => Price::class,
|
||||
'attrs' => JsonArray::class,
|
||||
'is_sell' => 'bool',
|
||||
'online_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,10 +28,13 @@ class CreateProductSpusTable extends Migration
|
|||
$table->string('media')->nullable()->comment('媒体地址');
|
||||
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
|
||||
$table->json('attrs')->nullable()->comment('属性文本');
|
||||
$table->tinyInteger('is_sell')->unsigned()->default(0)->comment('在售状态');
|
||||
$table->integer('stock')->unsigned()->default(0)->comment('库存');
|
||||
$table->integer('sales')->unsigned()->default(0)->comment('销量');
|
||||
$table->timestamp('online_at')->nullable()->comment('上线时间');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index('category_id');
|
||||
$table->index('online_at');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,14 +29,15 @@ class CreateProductSkusTable extends Migration
|
|||
$table->string('media')->nullable()->comment('媒体地址');
|
||||
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
|
||||
$table->json('attrs')->nullable()->comment('属性文本');
|
||||
$table->tinyInteger('is_sell')->unsigned()->default(0)->comment('在售状态');
|
||||
$table->json('spec_items')->nullable()->comment('规格属性');
|
||||
$table->json('specs')->nullable()->comment('规格属性');
|
||||
$table->integer('stock')->unsigned()->default(0)->comment('库存');
|
||||
$table->integer('sells')->unsigned()->default(0)->comment('销量');
|
||||
$table->integer('sales')->unsigned()->default(0)->comment('销量');
|
||||
$table->timestamp('online_at')->nullable()->comment('上线时间');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index('spu_id');
|
||||
$table->index('category_id');
|
||||
$table->index('online_at');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue