推荐商品

This commit is contained in:
liu
2026-08-31 22:21:59 +08:00
parent 6c809d893b
commit 9c59f3bc99
191 changed files with 2095 additions and 1 deletions
@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
* 小程序首页特价推荐:后台批量选择商品标记为推荐,小程序端按推荐排序展示
*/
public function up(): void
{
if (! Schema::hasTable('mini_home_special')) {
Schema::create('mini_home_special', function (Blueprint $table) {
$table->increments('id')->comment('推荐ID');
$table->integer('product_id')->comment('商品ID');
$table->integer('sort')->default(0)->comment('排序(越小越靠前)');
$table->integer('status')->default(1)->comment('状态(1正常 0停用)');
$table->timestamps();
$table->unique('product_id', 'uk_mini_home_special_product');
$table->index(['status', 'sort'], 'idx_mini_home_special_status_sort');
$table->comment('小程序首页特价推荐商品');
});
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('mini_home_special');
}
};