校园商户

This commit is contained in:
liu
2026-06-17 09:13:49 +08:00
parent 86be1c230e
commit 254823e308
50 changed files with 2186 additions and 40 deletions
@@ -8,20 +8,19 @@ return new class extends Migration
{
public function up(): void
{
// 话题分类
// 论坛板块
if (! Schema::hasTable('forum_categories')) {
Schema::create('forum_categories', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('parent_id')->default(0)->comment('父级ID');
$table->string('name', 50)->comment('分类名称');
$table->string('slug', 50)->comment('标识');
$table->string('description', 255)->default('')->comment('描述');
$table->string('name', 50)->comment('板块名称');
$table->string('description', 255)->default('')->comment('板块描述');
$table->string('icon', 255)->default('')->comment('图标');
$table->integer('sort')->default(0)->comment('排序');
$table->tinyInteger('status')->default(1)->comment('状态:0=禁用,1=正常');
$table->tinyInteger('review')->default(1)->comment('帖子是否审核:0=无需审核,1=需要审核');
$table->tinyInteger('comment_review')->default(1)->comment('评论是否审核:0=无需审核,1=需要审核');
$table->timestamps();
$table->index('slug');
$table->comment('话题分类');
$table->comment('帖子板块');
});
}
@@ -30,7 +29,7 @@ return new class extends Migration
Schema::create('forum_posts', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('user_id')->comment('发布用户ID');
$table->unsignedBigInteger('category_id')->nullable()->comment('分类ID');
$table->unsignedBigInteger('category_id')->nullable()->comment('帖子板块ID');
$table->string('title', 100)->comment('帖子标题');
$table->text('content')->comment('帖子内容');
$table->json('images')->nullable()->comment('图片列表');
@@ -40,7 +39,7 @@ return new class extends Migration
$table->integer('favorite_count')->default(0)->comment('收藏数');
$table->tinyInteger('is_hot')->default(0)->comment('是否热门:0=否,1=是');
$table->tinyInteger('is_top')->default(0)->comment('是否置顶:0=否,1=是');
$table->tinyInteger('status')->default(1)->comment('状态:0=草稿,1=发布,2=隐藏');
$table->tinyInteger('status')->default(1)->comment('状态:1=发布,2=隐藏');
$table->timestamps();
$table->softDeletes();
$table->index('user_id');
@@ -8,45 +8,21 @@ return new class extends Migration
{
public function up(): void
{
// 兼职岗位
if (! Schema::hasTable('part_time_jobs')) {
Schema::create('part_time_jobs', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('merchant_id')->nullable()->comment('发布商户ID');
$table->string('title', 100)->comment('岗位标题');
$table->text('description')->nullable()->comment('岗位描述');
$table->text('requirements')->nullable()->comment('任职要求');
$table->decimal('salary', 10, 2)->default(0)->comment('薪资');
$table->tinyInteger('salary_type')->default(1)->comment('薪资类型:1=时薪,2=日薪,3=月薪');
$table->string('location', 255)->default('')->comment('工作地点');
$table->string('contact_name', 30)->default('')->comment('联系人');
$table->string('contact_mobile', 20)->default('')->comment('联系电话');
$table->integer('quota')->default(1)->comment('招聘人数');
$table->integer('applied_count')->default(0)->comment('已申请人数');
$table->tinyInteger('status')->default(1)->comment('状态:0=草稿,1=发布,2=已关闭');
$table->date('start_date')->nullable()->comment('开始日期');
$table->date('end_date')->nullable()->comment('截止日期');
$table->timestamps();
$table->index('merchant_id');
$table->index('status');
$table->comment('兼职岗位');
});
}
// 兼职申请/报名
if (! Schema::hasTable('part_time_applications')) {
Schema::create('part_time_applications', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('job_id')->comment('岗位ID');
$table->unsignedInteger('user_id')->comment('申请用户ID');
$table->string('real_name', 30)->comment('真实姓名');
$table->string('mobile', 20)->comment('联系电话');
$table->string('resume', 500)->default('')->comment('个人简介/简历');
$table->string('id_card', 18)->comment('身份证号');
$table->string('id_card_front', 255)->default('')->comment('身份证正面照');
$table->string('id_card_back', 255)->default('')->comment('身份证背面照');
$table->tinyInteger('status')->default(0)->comment('状态:0=待审核,1=已通过,2=已拒绝');
$table->string('review_remark', 255)->default('')->comment('审核备注');
$table->timestamp('reviewed_at')->nullable()->comment('审核时间');
$table->timestamps();
$table->index('job_id');
$table->index('user_id');
$table->comment('兼职申请');
});
@@ -60,12 +36,11 @@ return new class extends Migration
$table->string('real_name', 30)->comment('真实姓名');
$table->string('mobile', 20)->comment('联系电话');
$table->string('id_card', 18)->comment('身份证号');
$table->string('id_card_front', 255)->default('')->comment('身份证正面照');
$table->string('id_card_back', 255)->default('')->comment('身份证背面照');
$table->decimal('balance', 10, 2)->default(0)->comment('佣金余额');
$table->decimal('total_income', 10, 2)->default(0)->comment('累计收入');
$table->tinyInteger('status')->default(0)->comment('状态:0=待认证,1=已认证,2=已拒绝');
$table->integer('total_order')->default(0)->comment('累计订单');
$table->decimal('credit_score', 10, 2)->default(100)->comment('信誉分');
$table->timestamp('verified_at')->nullable()->comment('认证时间');
$table->tinyInteger('status')->default(1)->comment('状态:0=禁止接单,1=正常');
$table->timestamps();
$table->index('user_id');
$table->index('mobile');