商品列表、分类管理、客户等级

This commit is contained in:
liu
2026-08-05 19:28:53 +08:00
parent dfa471bf22
commit 258df92e6c
36 changed files with 472 additions and 516 deletions
@@ -16,7 +16,7 @@ return new class extends Migration
if (! Schema::hasTable('customer_level')) {
Schema::create('customer_level', function (Blueprint $table) {
$table->increments('id')->comment('等级ID');
$table->integer('icon')->nullable()->comment('等级图标ID');
$table->integer('icon_id')->nullable()->comment('等级图标ID');
$table->string('name', 50)->comment('等级名称(如:一级客户、二级客户)');
$table->integer('sort')->default(0)->comment('排序');
$table->integer('status')->default(1)->comment('状态(1正常 0停用)');
@@ -17,7 +17,7 @@ return new class extends Migration
Schema::create('product_category', function (Blueprint $table) {
$table->increments('id')->comment('分类ID');
$table->integer('parent_id')->default(0)->comment('父级分类ID0为顶级)');
$table->integer('icon')->nullable()->comment('商品图标');
$table->integer('icon_id')->nullable()->comment('商品图标');
$table->string('name', 50)->comment('分类名称');
$table->integer('sort')->default(0)->comment('排序(采购单导出按此排序)');
$table->integer('status')->default(1)->comment('状态(1正常 0停用)');
@@ -36,8 +36,8 @@ return new class extends Migration
$table->string('name', 100)->comment('品名');
$table->string('spec', 100)->default('')->comment('规格/包规');
$table->string('unit', 20)->default('斤')->comment('计价单位(斤/件/箱等)');
$table->string('images', 255)->default('')->comment('商品图片');
$table->text('content')->default('')->comment('商品图文详情');
$table->string('image_ids', 255)->default('')->comment('商品图片');
$table->text('content')->comment('商品图文详情');
$table->integer('sort')->default(0)->comment('排序');
$table->integer('shelf_life')->default(0)->comment('保质期');
$table->integer('stock')->default(0)->comment('库存');
@@ -47,6 +47,7 @@ return new class extends Migration
$table->integer('sort')->default(0)->comment('排序(导出用)');
$table->integer('is_sent')->default(0)->comment('是否已发送供应商(1已发送 0未发送)');
$table->timestamp('sent_at')->nullable()->comment('发送时间');
$table->timestamp('supplier_confirmed_at')->nullable()->comment('供应商确认接单时间(NULL未确认)');
$table->string('remark', 255)->default('')->comment('备注');
$table->timestamps();
$table->index(['purchase_id'], 'purchase_order_item_purchase_index');
@@ -1,32 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* 待确认事项 #7(已批准):供应商小程序确认接单状态落库
*/
public function up(): void
{
if (! Schema::hasColumn('purchase_order_item', 'supplier_confirmed_at')) {
Schema::table('purchase_order_item', function (Blueprint $table) {
$table->timestamp('supplier_confirmed_at')->nullable()->after('sent_at')->comment('供应商确认接单时间(NULL未确认)');
});
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
if (Schema::hasColumn('purchase_order_item', 'supplier_confirmed_at')) {
Schema::table('purchase_order_item', function (Blueprint $table) {
$table->dropColumn('supplier_confirmed_at');
});
}
}
};