作为一个功能齐全的后台管理系统,我觉得应该再加上商品规格控件
作为一个功能齐全的后台管理系统,我觉得应该再加上商品规格控件
你们都整起了队形是吧...
其实我也是想给你贡献代码的,但是有些源代码没有完全理解 ,所以暂时还是先看下源码
------------------ 原始邮件 ------------------ 发件人: "Jiang Qinghua"<[email protected]>; 发送时间: 2020年6月15日(星期一) 上午10:35 收件人: "jqhph/dcat-admin"<[email protected]>; 抄送: "悠悠"<[email protected]>; "Author"<[email protected]>; 主题: Re: [jqhph/dcat-admin] 作为一个功能齐全的后台管理系统,我觉得应该再加上商品规格控件 (#219)
你们都整起了队形是吧...
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
加油
拒绝做伸手党
赞同增加sku
都想得美 作者如果增加sku控件可以参考 https://github.com/dnyz520/careyshop
都想得美 作者如果增加sku控件可以参考 https://github.com/dnyz520/careyshop
好的谢谢
正为这问题头疼呢,产品表下边有三个表,规格分组、规格、规格选项,跟正常的SKU有点区别,不知道怎么实现。
Schema::create('products', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('parent_category_id')->nullable()->index()->comment('父分类');
$table->unsignedInteger('category_id')->nullable()->index()->comment('分类');
$table->string('name')->nullable()->comment('名称');
$table->string('excerpt')->nullable()->comment('摘要');
$table->string('cover')->nullable()->comment('封面图');
$table->string('tips')->nullable()->comment('下单须知');
$table->longText('content')->nullable()->comment('内容');
$table->integer('order')->default(0)->comment('排序');
$table->boolean('status')->default(0)->comment('上架状态');
$table->timestamps();
$table->softDeletes();
});
DB::statement("ALTER TABLE `products` COMMENT '产品'");
Schema::create('spec_groups', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('product_id')->nullable()->index()->comment('产品');
$table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
$table->string('name')->nullable()->comment('名称');
$table->integer('order')->default(0)->comment('排序');
$table->timestamps();
$table->softDeletes();
});
DB::statement("ALTER TABLE `spec_groups` COMMENT '产品规格分组'");
Schema::create('specs', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('product_id')->nullable()->index()->comment('产品');
$table->unsignedInteger('spec_group_id')->nullable()->index()->comment('规格分组');
$table->foreign('spec_group_id')->references('id')->on('spec_groups')->onDelete('cascade');
$table->string('name')->nullable()->comment('名称');
$table->integer('order')->default(0)->comment('排序');
$table->timestamps();
$table->softDeletes();
});
DB::statement("ALTER TABLE `specs` COMMENT '产品规格'");
Schema::create('spec_items', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('product_id')->index()->comment('产品');
$table->unsignedInteger('spec_group_id')->index()->comment('规格分组');
$table->unsignedInteger('spec_id')->comment('规格');
$table->foreign('spec_id')->references('id')->on('specs')->onDelete('cascade');
$table->string('name')->nullable()->comment('名称');
$table->unsignedDecimal('price')->default(0)->comment('价格');
$table->integer('order')->default(0)->comment('排序');
$table->timestamps();
$table->softDeletes();
});
DB::statement("ALTER TABLE `spec_items` COMMENT '产品规格选项'");
希望早日加上吧!!!!