阶段更新

This commit is contained in:
2023-01-11 16:54:44 +08:00
parent ff55141a1e
commit 088dd64b2f
28 changed files with 807 additions and 238 deletions

View File

@@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAreasTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('areas', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id')->nullable()->index();
$table->string('title');
$table->string('mobile', 32);
$table->unsignedInteger('province_id');
$table->unsignedInteger('city_id');
$table->unsignedInteger('district_id');
$table->string('address');
$table->integer('stock')->default(0)->comment('库存');
$table->integer('sold')->default(0)->comment('领取数');
$table->boolean('status')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('areas');
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAreaCodesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('area_codes', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id')->nullable()->index();
$table->unsignedBigInteger('manage_id')->index();
$table->unsignedBigInteger('area_id')->index();
$table->string('code');
$table->boolean('status')->default(0);
$table->timestamp('pick_at')->nullable()->comment('提货时间');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('area_codes');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAreaClerksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('area_clerks', function (Blueprint $table) {
$table->id();
$table->unsignedInteger('area_id')->comment('订单')->index();
$table->unsignedInteger('user_id')->comment('操作员')->index();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('area_clerks');
}
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAreaStocksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('area_stocks', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('area_id');
$table->integer('amount')->comment('增加值');
$table->integer('stock')->comment('库存量');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('area_stocks');
}
}