diff --git a/app/Models/ProductSku.php b/app/Models/ProductSku.php index ee595dce..f854b2df 100644 --- a/app/Models/ProductSku.php +++ b/app/Models/ProductSku.php @@ -18,9 +18,30 @@ class ProductSku extends Model 'sell_price' => Price::class, 'market_price' => Price::class, 'cost_price' => Price::class, - 'user_price' => Price::class, + 'vip_price' => Price::class, 'attrs' => JsonArray::class, 'specs' => 'json', - 'online_at' => 'datetime', + 'release_at' => 'datetime', + ]; + + /** + * @var array + */ + protected $fillable = [ + 'name', + 'subtitle', + 'category_id', + 'codcovere', + 'images', + 'sell_price', + 'market_price', + 'cost_price', + 'vip_price', + 'media', + 'weight', + 'attrs', + 'stock', + 'sales', + 'release_at', ]; } diff --git a/app/Models/ProductSpu.php b/app/Models/ProductSpu.php index 36f06a4e..37435fc2 100644 --- a/app/Models/ProductSpu.php +++ b/app/Models/ProductSpu.php @@ -16,8 +16,29 @@ class ProductSpu extends Model 'sell_price' => Price::class, 'market_price' => Price::class, 'cost_price' => Price::class, - 'user_price' => Price::class, + 'vip_price' => Price::class, 'attrs' => JsonArray::class, - 'online_at' => 'datetime', + 'release_at' => 'datetime', + ]; + + /** + * @var array + */ + protected $fillable = [ + 'name', + 'subtitle', + 'category_id', + 'codcovere', + 'images', + 'sell_price', + 'market_price', + 'cost_price', + 'vip_price', + 'media', + 'weight', + 'attrs', + 'stock', + 'sales', + 'release_at', ]; } diff --git a/database/migrations/2021_11_22_110044_create_product_spus_table.php b/database/migrations/2021_11_22_110044_create_product_spus_table.php index de8ce9ab..9ff5a7c7 100644 --- a/database/migrations/2021_11_22_110044_create_product_spus_table.php +++ b/database/migrations/2021_11_22_110044_create_product_spus_table.php @@ -24,17 +24,17 @@ class CreateProductSpusTable extends Migration $table->bigInteger('sell_price')->unsigned()->default(0)->comment('销售价格:分'); $table->bigInteger('market_price')->unsigned()->default(0)->comment('市场价格:分'); $table->bigInteger('cost_price')->unsigned()->default(0)->comment('成本价格:分'); - $table->bigInteger('user_price')->unsigned()->nullable()->comment('会员价格:分'); + $table->bigInteger('vip_price')->unsigned()->nullable()->comment('会员价格:分'); $table->string('media')->nullable()->comment('媒体地址'); $table->integer('weight')->unsigned()->nullable()->comment('重量:g'); $table->json('attrs')->nullable()->comment('属性文本'); $table->integer('stock')->unsigned()->default(0)->comment('库存'); $table->integer('sales')->unsigned()->default(0)->comment('销量'); - $table->timestamp('online_at')->nullable()->comment('上线时间'); + $table->timestamp('release_at')->nullable()->comment('上架时间'); $table->timestamps(); $table->index('category_id'); - $table->index('online_at'); + $table->index('release_at'); }); } diff --git a/database/migrations/2021_11_24_120232_create_product_skus_table.php b/database/migrations/2021_11_24_120232_create_product_skus_table.php index 586c4b63..7fc7845a 100644 --- a/database/migrations/2021_11_24_120232_create_product_skus_table.php +++ b/database/migrations/2021_11_24_120232_create_product_skus_table.php @@ -25,19 +25,19 @@ class CreateProductSkusTable extends Migration $table->bigInteger('sell_price')->unsigned()->default(0)->comment('销售价格:分'); $table->bigInteger('market_price')->unsigned()->default(0)->comment('市场价格:分'); $table->bigInteger('cost_price')->unsigned()->default(0)->comment('成本价格:分'); - $table->bigInteger('user_price')->unsigned()->nullable()->comment('会员价格:分'); + $table->bigInteger('vip_price')->unsigned()->nullable()->comment('会员价格:分'); $table->string('media')->nullable()->comment('媒体地址'); $table->integer('weight')->unsigned()->nullable()->comment('重量:g'); $table->json('attrs')->nullable()->comment('属性文本'); $table->json('specs')->nullable()->comment('规格属性'); $table->integer('stock')->unsigned()->default(0)->comment('库存'); $table->integer('sales')->unsigned()->default(0)->comment('销量'); - $table->timestamp('online_at')->nullable()->comment('上线时间'); + $table->timestamp('release_at')->nullable()->comment('上架时间'); $table->timestamps(); $table->index('spu_id'); $table->index('category_id'); - $table->index('online_at'); + $table->index('release_at'); }); }