1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- class CreateOrdersTable extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('orders', function (Blueprint $table) {
- $table->id();
- $table->string('order_no', 30)->comment('订单号');
- $table->bigInteger('user_id')->default(0)->comment('用户id');
- $table->bigInteger('device_id')->default(0)->comment('设备id');
- $table->bigInteger('shop_id')->default(0)->comment('站点id');
- $table->tinyInteger('work_type')->default(0)->comment('工作类型');
- $table->integer('work_time')->default(0)->comment('工作时间');
- $table->timestamp('start_use_time')->nullable()->comment('开始时间');
- $table->timestamp('end_use_time')->nullable()->comment('结束时间');
- $table->decimal('time_money', 7, 2)->default(0.00)->comment('时长费用');
- $table->decimal('preferential_money', 7, 2)->default(0.00)->comment('优惠金额');
- $table->string('preferential_type')->default("-0-")->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->timestamp('pay_time')->nullable()->comment('支付时间');
- $table->tinyInteger('pay_type')->default(0)->comment('支付方式');
- $table->string('pay_result')->nullable()->comment('支付响应文件');
- $table->tinyInteger('status')->default(1);
- $table->timestamps();
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('orders');
- }
- }
|