表格修改
This commit is contained in:
parent
25dc1bd7ec
commit
80138234e9
@ -125,7 +125,6 @@ class LogSync extends Command
|
|||||||
$relation = $class->create($relationData);
|
$relation = $class->create($relationData);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
unset($relationData['counts']);
|
|
||||||
$relation = $class->upsert($relationData, ['sim', 'order_id', 'deleted_at']);
|
$relation = $class->upsert($relationData, ['sim', 'order_id', 'deleted_at']);
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
|
|
||||||
class CreateVirtualOrderCardsTable extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
if (Schema::hasTable('virtual_order_cards')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Schema::create('virtual_order_cards', function (Blueprint $table) {
|
|
||||||
$table->increments('id')->comment('关联表ID');
|
|
||||||
$table->bigInteger('sim')->unsigned()->default(0)->comment('sim号');
|
|
||||||
$table->integer('order_id')->unsigned()->default(0)->comment('订单ID');
|
|
||||||
$table->integer('company_id')->unsigned()->default(0)->comment('企业ID');
|
|
||||||
$table->integer('package_id')->unsigned()->default(0)->comment('套餐ID');
|
|
||||||
$table->timestamps();
|
|
||||||
$table->softDeletes();
|
|
||||||
|
|
||||||
$table->unique(['sim', 'order_id', 'deleted_at']);
|
|
||||||
|
|
||||||
$table->comment("VD订单企业套餐卡关联表");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('virtual_order_cards');
|
|
||||||
}
|
|
||||||
}
|
|
@ -7,9 +7,10 @@ use Illuminate\Database\Migrations\Migration;
|
|||||||
class CreateVirtualOrderCardsTables extends Migration
|
class CreateVirtualOrderCardsTables extends Migration
|
||||||
{
|
{
|
||||||
protected $tables = [
|
protected $tables = [
|
||||||
'virtual_order_renewal_cards' => 'VD卡关联基础订单',
|
'virtual_order_cards' => 'VD卡关联基础套餐订单',
|
||||||
|
'virtual_order_renewal_cards' => 'VD卡关联基础续费订单',
|
||||||
'virtual_order_renewal_package_cards' => 'VD卡关联续费包订单',
|
'virtual_order_renewal_package_cards' => 'VD卡关联续费包订单',
|
||||||
'virtual_order_flows_package_cards' => 'VD卡关联加油包订单',
|
'virtual_order_flows_package_cards' => 'VD卡关联加油包订单',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -25,12 +26,16 @@ class CreateVirtualOrderCardsTables extends Migration
|
|||||||
}
|
}
|
||||||
|
|
||||||
Schema::create($table_name, function (Blueprint $table) use ($table_comment) {
|
Schema::create($table_name, function (Blueprint $table) use ($table_comment) {
|
||||||
$table->integer('order_id')->unsigned()->default(0)->comment('订单ID');
|
$table->increments('id')->comment('关联表ID');
|
||||||
$table->bigInteger('sim')->unsigned()->default(0)->comment('SIM卡号');
|
$table->bigInteger('sim')->unsigned()->default(0)->comment('SIM卡号');
|
||||||
|
$table->integer('order_id')->unsigned()->default(0)->comment('订单ID');
|
||||||
$table->integer('company_id')->unsigned()->default(0)->comment('企业ID');
|
$table->integer('company_id')->unsigned()->default(0)->comment('企业ID');
|
||||||
$table->integer('package_id')->unsigned()->default(0)->comment('套餐ID');
|
$table->integer('package_id')->unsigned()->default(0)->comment('套餐ID');
|
||||||
$table->integer('counts')->unsigned()->default(1)->comment('数量');
|
$table->integer('counts')->unsigned()->default(1)->comment('数量');
|
||||||
$table->primary(['order_id', 'sim']);
|
$table->timestamps();
|
||||||
|
$table->softDeletes();
|
||||||
|
|
||||||
|
$table->unique(['order_id', 'sim', 'deleted_at']);
|
||||||
$table->comment($table_comment);
|
$table->comment($table_comment);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user