123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- use Illuminate\Support\Facades\Schema;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Database\Migrations\Migration;
- class CreateOrdersTable extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('orders', function (Blueprint $table) {
- $table->bigIncrements('id');
- $table->string('order_no', 30)->comment('订单号');
- $table->bigInteger('user_id')->default(0)->comment('用户id');
- $table->bigInteger('bike_id')->default(0)->comment('车id');
- $table->bigInteger('area_id')->default(0)->comment('区域id');
- $table->timestamp('start_use_bike_time')->nullable()->comment('开始时间');
- $table->timestamp('end_use_bike_time')->nullable()->comment('结束时间');
- $table->integer('use_bike_time_length')->default(0)->comment('骑行时间(分)');
- $table->integer('pause_bike_time_length')->default(0)->comment('暂停时间(分)');
- $table->integer('use_bike_distance_length')->default(0)->comment('骑行距离(千米)');
- $table->decimal('time_money', 7, 2)->default(0.00)->comment('时长费用');
- $table->decimal('distance_money', 7, 2)->default(0.00)->comment('里程费用');
- $table->decimal('pause_money', 7, 2)->default(0.00)->comment('停车费');
- $table->decimal('dispatch_money', 7, 2)->default(0.00)->comment('调度费');
- $table->decimal('preferential_money', 7, 2)->default(0.00)->comment('优惠金额');
- $table->decimal('total_money', 7, 2)->default(0.00)->comment('总价格');
- $table->tinyInteger('pay_status')->default(0)->comment('支付状态');
- $table->decimal('pay_money', 7, 2)->default(0.00)->comment('支付金额');
- $table->tinyInteger('pay_type')->default(0)->comment('支付方式(0:未支付;1已支付)');
- $table->tinyInteger('status')->default(1);
- $table->timestamps();
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('orders');
- }
- }
|