6
0
Fork 0

添加商品成长值

release
vine_liutk 2021-12-22 15:31:36 +08:00
parent 52e94dde28
commit 9c3b473ca7
10 changed files with 77 additions and 0 deletions

View File

@ -120,6 +120,7 @@ class ProductSkuController extends AdminController
}
return bcmul($vipPrice, 100);
});
$form->number('growth_value')->min(0)->default(0);
$form->divider();
$form->select('attr_group')->options(ProductGroup::all()->pluck('name', 'id'));
$form->selectAttr('attrs')->listen('attr_group');

View File

@ -49,6 +49,7 @@ class ProductSpuController extends AdminController
return '¥'.bcdiv($value, 100, 2);
});
$grid->column('weight');
$grid->column('growth_value');
$grid->column('created_at')->sortable();
//排序
@ -183,6 +184,7 @@ class ProductSpuController extends AdminController
}
return bcmul($vipPrice, 100);
});
$form->number('growth_value')->min(0)->default(0);
$form->divider();
$form->select('attr_group')->options(ProductGroup::all()->pluck('name', 'id'));
$form->selectAttr('attrs')->listen('attr_group');

View File

@ -65,6 +65,7 @@ class ProductSkuTable extends Grid
return '¥'.bcdiv($value, 100, 2);
});
$grid->column('weight');
$grid->column('growth_value');
$grid->column('stock');
$grid->column('sales');
$grid->column('verify_state')

View File

@ -62,6 +62,7 @@ class ProductSku extends Model
'stock',
'sales',
'release_at',
'growth_value',
];
/**

View File

@ -52,6 +52,7 @@ class ProductSpu extends Model
'stock',
'sales',
'release_at',
'growth_value',
];
public function skus()

View File

@ -120,6 +120,7 @@ trait SkuInfo
'buynote_id' => $spu->buynote_id,
'shipping_template_id'=> $spu->shipping_template_id,
'verify_state' => 0, //默认为正常
'growth_value' => $spu->growth_value,
];
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddGrowthValueToProductSpusTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('product_spus', function (Blueprint $table) {
//
$table->unsignedBigInteger('growth_value')->default(0)->comment('等级成长值');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('product_spus', function (Blueprint $table) {
//
$table->dropColumn('product_spus');
});
}
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddGrowthValueToProductSkusTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('product_skus', function (Blueprint $table) {
//
$table->unsignedBigInteger('growth_value')->default(0)->comment('等级成长值');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('product_skus', function (Blueprint $table) {
//
$table->dropColumn('product_skus');
});
}
}

View File

@ -38,6 +38,7 @@ return [
'gift_sku_id'=>'赠品名称',
'num'=>'赠送数量',
'limit'=>'限量',
'growth_value'=>'成长值',
],
'options' => [
'deny' => '删除失败',

View File

@ -30,6 +30,7 @@ return [
'attr_group'=>'商品分组',
'verify_state'=>'状态',
'release_at'=>'上架时间',
'growth_value'=>'成长值',
],
'options' => [
'deny' => '删除失败',