2019_11_22_094024_create_waybills_table.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateWaybillsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('waybills', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->timestamps();
  17. $table->enum('status',['未审核','已审核','待重审','待终审','已完结','无模型'])->default('未审核')->index()->comment('状态');
  18. $table->enum('type',['直发车','专线'])->comment('类型');
  19. $table->string('waybill_number',50)->unique()->index()->comment('运单号');
  20. $table->bigInteger('owner_id')->index()->comment('货主');
  21. $table->string('wms_bill_number',50)->unique()->nullable()->comment('WMS单号');
  22. $table->string('origination',50)->comment('始发地');
  23. $table->string('destination',50)->comment('目的地');
  24. $table->string('recipient',50)->comment('收件人');
  25. $table->string('recipient_mobile',50)->comment('收件人电话');
  26. $table->decimal('charge')->comment('收费(元)')->nullable();
  27. $table->decimal('collect_fee')->nullable()->comment('到付金额');
  28. $table->text('ordering_remark')->nullable()->comment('下单备注');
  29. $table->bigInteger('carrier_id')->nullable()->index()->comment('承运商');
  30. $table->string('carrier_bill')->nullable()->unique()->comment('承运商单号');
  31. $table->bigInteger('origination_city_id')->nullable()->index()->comment('始发市');
  32. $table->bigInteger('destination_city_id')->nullable()->index()->comment('目的市');
  33. $table->decimal('warehouse_weight')->nullable()->comment('仓库计重(抛)');
  34. $table->bigInteger('warehouse_weight_unit_id')->nullable()->index()->comment('仓库计重单位');
  35. $table->decimal('carrier_weight')->nullable()->comment('承运商计重(抛)');
  36. $table->bigInteger('carrier_weight_unit_id')->nullable()->index()->comment('承运商计重单位');
  37. $table->bigInteger('carType_id')->nullable()->comment('车型');
  38. $table->decimal('fee')->nullable()->comment('运费');
  39. $table->decimal('pick_up_fee')->nullable()->comment('提货费');
  40. $table->decimal('other_fee')->nullable()->comment('其他费用');
  41. $table->text('dispatch_remark')->nullable()->comment('调度备注');
  42. $table->bigInteger('waybill_price_model_id')->nullable()->index()->comment('外联计费模型');
  43. });
  44. }
  45. /**
  46. * Reverse the migrations.
  47. *
  48. * @return void
  49. */
  50. public function down()
  51. {
  52. Schema::dropIfExists('waybills');
  53. }
  54. }