45 lines
1.3 KiB
PHP
45 lines
1.3 KiB
PHP
<?php
|
|
|
|
use think\admin\extend\PhinxExtend;
|
|
use think\migration\Migrator;
|
|
|
|
@set_time_limit(0);
|
|
@ini_set('memory_limit', -1);
|
|
|
|
class InstallOrderTable extends Migrator
|
|
{
|
|
|
|
/**
|
|
* 创建数据库
|
|
*/
|
|
public function change()
|
|
{
|
|
$this->_create_order_tk();
|
|
}
|
|
|
|
/**
|
|
* 创建数据对象
|
|
* @class OrderTk
|
|
* @table order_tk
|
|
* @return void
|
|
*/
|
|
private function _create_order_tk()
|
|
{
|
|
// 创建数据表对象
|
|
$table = $this->table('order_tk', [
|
|
'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '',
|
|
]);
|
|
// 创建或更新数据表
|
|
PhinxExtend::upgrade($table, [
|
|
['mid', 'integer', ['default' => NULL, 'null' => false, 'comment' => '商户id']],
|
|
['order_id', 'string', ['limit' => 800, 'default' => NULL, 'null' => true, 'comment' => '本站订单id']],
|
|
['merchant_order_id', 'string', ['limit' => 1000, 'default' => NULL, 'null' => true, 'comment' => '商户订单id']],
|
|
['status', 'tinyinteger', ['limit' => 1, 'default' => 1, 'null' => false, 'comment' => '1待处理2退款成功3退款失败']],
|
|
['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => false, 'comment' => '']],
|
|
], [
|
|
'status', 'order_id', 'merchant_order_id',
|
|
], false);
|
|
}
|
|
|
|
}
|