订单详情
This commit is contained in:
@@ -21,12 +21,19 @@ class StoreOrderItemModelFactory extends Factory
|
||||
'order_id' => 0,
|
||||
'store_id' => 0,
|
||||
'product_id' => 0,
|
||||
'category_id' => 0,
|
||||
'supplier_id' => 0,
|
||||
'product_name' => '测试商品',
|
||||
'product_spec' => '500g/袋',
|
||||
'unit' => '斤',
|
||||
'price' => number_format(random_int(100, 5000) / 100, 2, '.', ''),
|
||||
'image_ids' => '',
|
||||
'content' => '',
|
||||
'shelf_life' => 0,
|
||||
'quantity' => number_format(random_int(100, 10000) / 100, 2, '.', ''),
|
||||
'weight' => 0,
|
||||
'amount' => 0,
|
||||
'cost_price' => 0,
|
||||
'remark' => '',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -42,14 +42,21 @@ return new class extends Migration
|
||||
Schema::create('store_order_item', function (Blueprint $table) {
|
||||
$table->increments('id')->comment('明细ID');
|
||||
$table->integer('order_id')->comment('订单ID');
|
||||
$table->integer('store_id')->comment('门店ID(冗余,便于按门店筛选)');
|
||||
$table->integer('store_id')->comment('门店ID');
|
||||
$table->integer('product_id')->comment('商品ID');
|
||||
$table->string('product_name', 100)->comment('品名(快照)');
|
||||
$table->string('product_spec', 100)->default('')->comment('规格/包规(快照)');
|
||||
$table->decimal('price', 10, 2)->default(0)->comment('单价(下单时客户等级价快照)');
|
||||
$table->integer('category_id')->default(0)->comment('分类ID');
|
||||
$table->integer('supplier_id')->default(0)->comment('供应商ID');
|
||||
$table->string('product_name', 100)->comment('品名');
|
||||
$table->string('product_spec', 100)->default('')->comment('规格/包规');
|
||||
$table->string('unit', 20)->default('斤')->comment('计价单位(斤/件/箱等)');
|
||||
$table->decimal('price', 10, 2)->default(0)->comment('单价');
|
||||
$table->string('image_ids', 255)->default('')->comment('商品图片');
|
||||
$table->text('content')->comment('商品图文详情');
|
||||
$table->integer('shelf_life')->default(0)->comment('保质期');
|
||||
$table->integer('quantity')->default(0)->comment('订货量');
|
||||
$table->decimal('weight', 10, 3)->default(0)->comment('重量');
|
||||
$table->decimal('amount', 10, 2)->default(0)->comment('单品金额');
|
||||
$table->decimal('cost_price', 10, 2)->default(0)->comment('成本价');
|
||||
$table->string('remark', 255)->default('')->comment('门店下单备注');
|
||||
$table->timestamps();
|
||||
$table->index(['order_id'], 'store_order_item_order_index');
|
||||
|
||||
Reference in New Issue
Block a user