修复生产统计与维修记录用户数据

This commit is contained in:
2026-09-06 21:06:36 +08:00
parent 02c8fb7021
commit 5ca6ef2d5a
41 changed files with 1838 additions and 205 deletions
@@ -0,0 +1,46 @@
<?php
declare(strict_types=1);
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
return new class {
public function up(Builder $schema): void
{
$table = 'produce_member_notification';
if ($schema->hasTable($table)) {
return;
}
$schema->create($table, function (Blueprint $table): void {
$table->bigInteger('id')->primary()->comment('主键');
$table->bigInteger('member_id')->nullable()->comment('接收会员ID');
$table->string('user_code', 64)->comment('接收用户编码');
$table->string('type', 32)->default('repair_responsibility')->comment('通知类型');
$table->string('title', 120)->comment('通知标题');
$table->text('content')->comment('通知内容');
$table->bigInteger('repair_id')->nullable()->comment('维修记录ID');
$table->string('repair_no', 64)->nullable()->comment('维修单号');
$table->string('order_no', 64)->nullable()->comment('订单号');
$table->tinyInteger('status')->default(0)->comment('阅读状态:0未读,1已读');
$table->bigInteger('read_at')->nullable()->comment('阅读时间');
$table->bigInteger('created_at')->nullable()->comment('创建时间');
$table->bigInteger('updated_at')->nullable()->comment('更新时间');
$table->bigInteger('deleted_at')->nullable()->comment('删除时间');
$table->index(['member_id', 'status'], 'idx_member_notification_status');
$table->index(['user_code', 'created_at'], 'idx_member_notification_user_code');
$table->index('repair_id', 'idx_member_notification_repair_id');
});
}
public function down(Builder $schema): void
{
$table = 'produce_member_notification';
if (!$schema->hasTable($table)) {
return;
}
$schema->drop($table);
}
};