商品 SPU、SKU 增加推荐
parent
3baa372b4b
commit
f463805d73
|
|
@ -5,10 +5,12 @@ namespace App\Models;
|
||||||
use App\Casts\JsonArray;
|
use App\Casts\JsonArray;
|
||||||
use App\Casts\Price;
|
use App\Casts\Price;
|
||||||
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
use Dcat\Admin\Traits\HasDateTimeFormatter;
|
||||||
|
use EloquentFilter\Filterable;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class ProductSku extends Model
|
class ProductSku extends Model
|
||||||
{
|
{
|
||||||
|
use Filterable;
|
||||||
use HasDateTimeFormatter;
|
use HasDateTimeFormatter;
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
|
|
@ -19,5 +21,6 @@ class ProductSku extends Model
|
||||||
'user_price' => Price::class,
|
'user_price' => Price::class,
|
||||||
'attrs' => JsonArray::class,
|
'attrs' => JsonArray::class,
|
||||||
'is_sell' => 'bool',
|
'is_sell' => 'bool',
|
||||||
|
'is_recommend' => 'bool',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
class ProductSpu extends Model
|
class ProductSpu extends Model
|
||||||
{
|
{
|
||||||
use HasDateTimeFormatter;
|
use HasDateTimeFormatter;
|
||||||
protected $table = 'product_spus';
|
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'images' => JsonArray::class,
|
'images' => JsonArray::class,
|
||||||
|
|
@ -20,5 +19,6 @@ class ProductSpu extends Model
|
||||||
'user_price' => Price::class,
|
'user_price' => Price::class,
|
||||||
'attrs' => JsonArray::class,
|
'attrs' => JsonArray::class,
|
||||||
'is_sell' => 'bool',
|
'is_sell' => 'bool',
|
||||||
|
'is_recommend' => 'bool',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ class CreateProductSpusTable extends Migration
|
||||||
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
|
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
|
||||||
$table->json('attrs')->nullable()->comment('属性文本');
|
$table->json('attrs')->nullable()->comment('属性文本');
|
||||||
$table->tinyInteger('is_sell')->unsigned()->default(0)->comment('在售状态');
|
$table->tinyInteger('is_sell')->unsigned()->default(0)->comment('在售状态');
|
||||||
|
$table->tinyInteger('is_recommend')->unsigned()->default(0)->comment('是否推荐');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ class CreateProductSkusTable extends Migration
|
||||||
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
|
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
|
||||||
$table->json('attrs')->nullable()->comment('属性文本');
|
$table->json('attrs')->nullable()->comment('属性文本');
|
||||||
$table->tinyInteger('is_sell')->unsigned()->default(0)->comment('在售状态');
|
$table->tinyInteger('is_sell')->unsigned()->default(0)->comment('在售状态');
|
||||||
|
$table->tinyInteger('is_recommend')->unsigned()->default(0)->comment('是否推荐');
|
||||||
$table->json('spec_items')->nullable()->comment('规格属性');
|
$table->json('spec_items')->nullable()->comment('规格属性');
|
||||||
$table->integer('stock')->unsigned()->default(0)->comment('库存');
|
$table->integer('stock')->unsigned()->default(0)->comment('库存');
|
||||||
$table->integer('sells')->unsigned()->default(0)->comment('销量');
|
$table->integer('sells')->unsigned()->default(0)->comment('销量');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue