商品重量默认为 0 g
parent
adc099d6f6
commit
99efee83fc
|
|
@ -17,6 +17,15 @@ class ProductSku extends Model
|
|||
use Release;
|
||||
use SkuInfo;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $attributes = [
|
||||
'weight' => 0,
|
||||
'stock' => 0,
|
||||
'sales' => 0,
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -11,6 +11,18 @@ class ProductSpu extends Model
|
|||
{
|
||||
use HasDateTimeFormatter;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $attributes = [
|
||||
'weight' => 0,
|
||||
'stock' => 0,
|
||||
'sales' => 0,
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'images' => JsonArray::class,
|
||||
'sell_price' => Price::class,
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class CreateProductSpusTable extends Migration
|
|||
$table->bigInteger('cost_price')->unsigned()->default(0)->comment('成本价格:分');
|
||||
$table->bigInteger('vip_price')->unsigned()->nullable()->comment('会员价格:分');
|
||||
$table->string('media')->nullable()->comment('媒体地址');
|
||||
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
|
||||
$table->integer('weight')->unsigned()->default(0)->comment('重量:g');
|
||||
$table->json('attrs')->nullable()->comment('属性文本');
|
||||
$table->integer('stock')->unsigned()->default(0)->comment('库存');
|
||||
$table->integer('sales')->unsigned()->default(0)->comment('销量');
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class CreateProductSkusTable extends Migration
|
|||
$table->bigInteger('cost_price')->unsigned()->default(0)->comment('成本价格:分');
|
||||
$table->bigInteger('vip_price')->unsigned()->nullable()->comment('会员价格:分');
|
||||
$table->string('media')->nullable()->comment('媒体地址');
|
||||
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
|
||||
$table->integer('weight')->unsigned()->default(0)->comment('重量:g');
|
||||
$table->json('attrs')->nullable()->comment('属性文本');
|
||||
$table->json('specs')->nullable()->comment('规格属性');
|
||||
$table->integer('stock')->unsigned()->default(0)->comment('库存');
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class CreateOrdersTable extends Migration
|
|||
$table->unsignedBigInteger('shipping_fee')->default(0)->comment('运费');
|
||||
$table->unsignedBigInteger('products_total_amount')->comment('商品总额');
|
||||
$table->unsignedBigInteger('total_amount')->comment('订单总额(支付金额)=商品总额+运费-优惠券金额-会员优惠-减免金额');
|
||||
$table->unsignedInteger('weight')->nullable()->comment('订单重量');
|
||||
$table->unsignedInteger('weight')->default(0)->comment('订单重量');
|
||||
$table->string('note')->nullable()->comment('客户备注');
|
||||
$table->string('remark')->nullable()->comment('订单备注');
|
||||
// 支付信息
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class CreateOrderProductsTable extends Migration
|
|||
$table->string('cover')->nullable()->comment('商品封面');
|
||||
$table->json('specs')->nullable()->comment('规格属性');
|
||||
$table->unsignedInteger('quantity')->comment('数量');
|
||||
$table->unsignedInteger('weight')->nullable()->comment('重量:g');
|
||||
$table->unsignedInteger('weight')->default(0)->comment('重量:g');
|
||||
$table->unsignedBigInteger('sell_price')->comment('商品价格');
|
||||
$table->unsignedBigInteger('vip_price')->nullable()->comment('会员价格');
|
||||
$table->unsignedBigInteger('coupon_disount_amount')->default(0)->comment('优惠券金额');
|
||||
|
|
|
|||
Loading…
Reference in New Issue