推荐商品
This commit is contained in:
@@ -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');
|
||||
}
|
||||
};
|
||||
@@ -271,6 +271,18 @@ class PermissionSeeder extends Seeder
|
||||
['type' => 'rule', 'key' => 'client.promo.delete', 'name' => '删除'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'route',
|
||||
'key' => 'client.special',
|
||||
'name' => '特价推荐',
|
||||
'path' => '/client/special',
|
||||
'children' => [
|
||||
['type' => 'rule', 'key' => 'client.special.query', 'name' => '查询'],
|
||||
['type' => 'rule', 'key' => 'client.special.create', 'name' => '新增'],
|
||||
['type' => 'rule', 'key' => 'client.special.update', 'name' => '编辑'],
|
||||
['type' => 'rule', 'key' => 'client.special.delete', 'name' => '删除'],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user