diff --git a/packages/goods/src/Filters/GoodsFilter.php b/packages/goods/src/Filters/GoodsFilter.php new file mode 100644 index 0000000..325ceaf --- /dev/null +++ b/packages/goods/src/Filters/GoodsFilter.php @@ -0,0 +1,10 @@ + 'array', ]; + public function modelFilter() + { + return GoodsFilter::class; + } + public function category() { return $this->belongsTo(GoodsCategory::class, 'category_id'); diff --git a/packages/goods/updates/CreateGoodsTable.php b/packages/goods/updates/CreateGoodsTable.php index 5f3d4da..d33ad1a 100644 --- a/packages/goods/updates/CreateGoodsTable.php +++ b/packages/goods/updates/CreateGoodsTable.php @@ -47,6 +47,7 @@ class CreateGoodsTable extends Migration Schema::create('goods', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('category_id')->comment('所属分类, 关联 goods_category.id'); + $table->unsignedBigInteger('merchant_id')->nullable()->comment('商户ID'); $table->unsignedBigInteger('type_id')->nullable()->comment('所属类别'); $table->unsignedBigInteger('brand_id')->nullable()->comment('所属品牌'); $table->string('name')->comment('商品名称');