6
0
Fork 0

商品 SPU、SKU 增加推荐

release
李静 2021-11-25 17:35:16 +08:00
parent 3baa372b4b
commit f463805d73
4 changed files with 6 additions and 1 deletions

View File

@ -5,10 +5,12 @@ namespace App\Models;
use App\Casts\JsonArray;
use App\Casts\Price;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use EloquentFilter\Filterable;
use Illuminate\Database\Eloquent\Model;
class ProductSku extends Model
{
use Filterable;
use HasDateTimeFormatter;
protected $casts = [
@ -19,5 +21,6 @@ class ProductSku extends Model
'user_price' => Price::class,
'attrs' => JsonArray::class,
'is_sell' => 'bool',
'is_recommend' => 'bool',
];
}

View File

@ -10,7 +10,6 @@ use Illuminate\Database\Eloquent\Model;
class ProductSpu extends Model
{
use HasDateTimeFormatter;
protected $table = 'product_spus';
protected $casts = [
'images' => JsonArray::class,
@ -20,5 +19,6 @@ class ProductSpu extends Model
'user_price' => Price::class,
'attrs' => JsonArray::class,
'is_sell' => 'bool',
'is_recommend' => 'bool',
];
}

View File

@ -29,6 +29,7 @@ class CreateProductSpusTable extends Migration
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
$table->json('attrs')->nullable()->comment('属性文本');
$table->tinyInteger('is_sell')->unsigned()->default(0)->comment('在售状态');
$table->tinyInteger('is_recommend')->unsigned()->default(0)->comment('是否推荐');
$table->timestamps();
});
}

View File

@ -30,6 +30,7 @@ class CreateProductSkusTable extends Migration
$table->integer('weight')->unsigned()->nullable()->comment('重量:g');
$table->json('attrs')->nullable()->comment('属性文本');
$table->tinyInteger('is_sell')->unsigned()->default(0)->comment('在售状态');
$table->tinyInteger('is_recommend')->unsigned()->default(0)->comment('是否推荐');
$table->json('spec_items')->nullable()->comment('规格属性');
$table->integer('stock')->unsigned()->default(0)->comment('库存');
$table->integer('sells')->unsigned()->default(0)->comment('销量');