_create_service_info(); $this->_create_service_product(); $this->_create_service_system(); $this->_create_service_system_api(); $this->_create_service_system_col(); } /** * 创建数据对象 * @class ServiceInfo * @table service_info * @return void */ private function _create_service_info() { // 创建数据表对象 $table = $this->table('service_info', [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '业务表', ]); // 创建或更新数据表 PhinxExtend::upgrade($table, [ ['name', 'string', ['limit' => 100, 'default' => NULL, 'null' => false, 'comment' => '']], ['key', 'string', ['limit' => 100, 'default' => NULL, 'null' => false, 'comment' => '关键字']], ['type', 'integer', ['default' => '1', 'null' => false, 'comment' => '1加油卡2话费']], ['option', 'string', ['limit' => 500, 'default' => NULL, 'null' => true, 'comment' => '可选项,影响折扣']], ['col_required_value', 'string', ['limit' => 1000, 'default' => NULL, 'null' => true, 'comment' => '必填字段']], ['col_option_value', 'string', ['limit' => 1000, 'default' => NULL, 'null' => true, 'comment' => '选填字段']], ['status', 'tinyinteger', ['limit' => 1, 'default' => 1, 'null' => false, 'comment' => '']], ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => false, 'comment' => '']], ], [ ], false); } /** * 创建数据对象 * @class ServiceProduct * @table service_product * @return void */ private function _create_service_product() { // 创建数据表对象 $table = $this->table('service_product', [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '业务产品表', ]); // 创建或更新数据表 PhinxExtend::upgrade($table, [ ['service_id', 'integer', ['default' => NULL, 'null' => false, 'comment' => '']], ['name', 'string', ['limit' => 100, 'default' => NULL, 'null' => false, 'comment' => '']], ['value', 'string', ['limit' => 100, 'default' => NULL, 'null' => false, 'comment' => '']], ['sort', 'integer', ['default' => '1', 'null' => false, 'comment' => '排序,正序']], ['status', 'tinyinteger', ['limit' => 1, 'default' => 1, 'null' => false, 'comment' => '1启用2禁用']], ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => false, 'comment' => '']], ], [ ], false); } /** * 创建数据对象 * @class ServiceSystem * @table service_system * @return void */ private function _create_service_system() { // 创建数据表对象 $table = $this->table('service_system', [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统管理', ]); // 创建或更新数据表 PhinxExtend::upgrade($table, [ ['name', 'string', ['limit' => 100, 'default' => NULL, 'null' => false, 'comment' => '']], ['sign', 'tinyinteger', ['limit' => 1, 'default' => 1, 'null' => false, 'comment' => '加密算法方式']], ['sign_convert', 'tinyinteger', ['limit' => 1, 'default' => 1, 'null' => false, 'comment' => '']], ['sign_type', 'tinyinteger', ['limit' => 1, 'default' => 1, 'null' => false, 'comment' => '']], ['sign_sort', 'tinyinteger', ['limit' => 1, 'default' => 1, 'null' => false, 'comment' => '']], ['status', 'tinyinteger', ['limit' => 1, 'default' => 1, 'null' => false, 'comment' => '1可用2禁用']], ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => false, 'comment' => '']], ], [ ], false); } /** * 创建数据对象 * @class ServiceSystemApi * @table service_system_api * @return void */ private function _create_service_system_api() { // 创建数据表对象 $table = $this->table('service_system_api', [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', ]); // 创建或更新数据表 PhinxExtend::upgrade($table, [ ['system_id', 'integer', ['default' => NULL, 'null' => false, 'comment' => '']], ['service_id', 'string', ['limit' => 100, 'default' => '0', 'null' => false, 'comment' => '支持的业务id,多个用逗号隔开']], ['service_key', 'string', ['limit' => 100, 'default' => NULL, 'null' => true, 'comment' => '']], ['type', 'tinyinteger', ['limit' => 1, 'default' => 1, 'null' => false, 'comment' => '']], ['api', 'string', ['limit' => 100, 'default' => NULL, 'null' => false, 'comment' => '接口地址']], ['request_method', 'tinyinteger', ['limit' => 1, 'default' => 1, 'null' => false, 'comment' => '请求方式']], ['header', 'string', ['limit' => 1000, 'default' => NULL, 'null' => true, 'comment' => 'header参数']], ['success_key', 'string', ['limit' => 100, 'default' => NULL, 'null' => true, 'comment' => '响应成功字段名']], ['success_value', 'string', ['limit' => 100, 'default' => NULL, 'null' => true, 'comment' => '响应成功字段值']], ['msg_key', 'string', ['limit' => 100, 'default' => NULL, 'null' => true, 'comment' => '响应消息字段名']], ['channel_order_id', 'string', ['limit' => 100, 'default' => NULL, 'null' => true, 'comment' => '上游订单号字段名']], ['notify_status_col', 'string', ['limit' => 100, 'default' => NULL, 'null' => true, 'comment' => '回调状态字段名']], ['notify_status_value', 'string', ['limit' => 100, 'default' => NULL, 'null' => true, 'comment' => '回调状态字段值']], ['notify_number', 'string', ['limit' => 100, 'default' => NULL, 'null' => true, 'comment' => '回调流水号的字段值']], ['notify_msg', 'string', ['limit' => 100, 'default' => 'success', 'null' => true, 'comment' => '回调成功字符串的值']], ['status', 'tinyinteger', ['limit' => 1, 'default' => 1, 'null' => false, 'comment' => '']], ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => false, 'comment' => '']], ], [ ], false); } /** * 创建数据对象 * @class ServiceSystemCol * @table service_system_col * @return void */ private function _create_service_system_col() { // 创建数据表对象 $table = $this->table('service_system_col', [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', ]); // 创建或更新数据表 PhinxExtend::upgrade($table, [ ['system_id', 'integer', ['default' => NULL, 'null' => false, 'comment' => '']], ['api_id', 'integer', ['default' => NULL, 'null' => false, 'comment' => '']], ['name', 'string', ['limit' => 100, 'default' => NULL, 'null' => true, 'comment' => '']], ['type', 'integer', ['default' => '1', 'null' => false, 'comment' => '']], ['value', 'string', ['limit' => 1000, 'default' => NULL, 'null' => true, 'comment' => '']], ['option', 'integer', ['default' => '1', 'null' => false, 'comment' => '1必填2选填']], ['sign', 'tinyinteger', ['limit' => 1, 'default' => 1, 'null' => false, 'comment' => '1参与加密2不参与加密']], ['create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => false, 'comment' => '']], ], [ ], false); } }