本文整理汇总了PHP中invoice::max方法的典型用法代码示例。如果您正苦于以下问题:PHP invoice::max方法的具体用法?PHP invoice::max怎么用?PHP invoice::max使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类invoice
的用法示例。
在下文中一共展示了invoice::max方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSystemDefaults
$patch['208']['date'] = "20090826";
$defaults = getSystemDefaults();
$patch['209']['name'] = "Populate the status, locale, and language fields in preferences table";
$patch['209']['patch'] = "UPDATE `" . TB_PREFIX . "preferences` SET index_group = '" . $defaults['preference'] . "' ;";
$patch['209']['date'] = "20090826";
$patch['210']['name'] = "Create composite primary key for invoice table";
$patch['210']['patch'] = "ALTER TABLE `" . TB_PREFIX . "invoices` DROP PRIMARY KEY, ADD PRIMARY KEY(`domain_id`,`id` );";
$patch['210']['date'] = "20090826";
$patch['211']['name'] = "Reset auto-increment for invoice table";
$patch['211']['patch'] = "ALTER TABLE `" . TB_PREFIX . "invoices` AUTO_INCREMENT = 1;";
$patch['211']['date'] = "20090826";
$patch['212']['name'] = "Copy invoice.id into invoice.index_id";
$patch['212']['patch'] = "update `" . TB_PREFIX . "invoices` set index_id = id;";
$patch['212']['date'] = "20090902";
$invoiceobj = new invoice();
$max_invoice = $invoiceobj->max();
unset($invoiceobj);
$patch['213']['name'] = "Update the index table with max invoice id - if required";
if ($max_invoice > "0") {
$patch['213']['patch'] = "insert into `" . TB_PREFIX . "index` (id, node, sub_node, domain_id) VALUES (" . $max_invoice . ", 'invoice', '" . $defaults['preference'] . "','1');";
} else {
$patch['213']['patch'] = "select 1+1;";
}
$patch['213']['date'] = "20090902";
unset($defaults);
unset($max_invoice);
$patch['214']['name'] = "Add sub_node_2 to si_index table";
$patch['214']['patch'] = "ALTER TABLE `" . TB_PREFIX . "index` ADD `sub_node_2` VARCHAR( 255 ) NULL AFTER `sub_node`";
$patch['214']['date'] = "20090912";
$patch['215']['name'] = "si_invoices - add composite primary key - patch removed";
#$patch['215']['patch'] = "ALTER TABLE `".TB_PREFIX."index` DROP PRIMARY KEY, ADD PRIMARY KEY(`domain_id`, `id`)";
示例2: INT
$patch['208']['patch'] = "ALTER TABLE `" . TB_PREFIX . "preferences` ADD `index_group` INT( 11 ) NOT NULL ;";
$patch['208']['date'] = "20090826";
$defaults = getSystemDefaults();
$patch['209']['name'] = "Populate the status, locale, and language fields in preferences table";
$patch['209']['patch'] = "UPDATE `" . TB_PREFIX . "preferences` SET index_group = '" . $defaults['preference'] . "' ;";
$patch['209']['date'] = "20090826";
$patch['210']['name'] = "Create composite primary key for invoice table";
$patch['210']['patch'] = "ALTER TABLE `" . TB_PREFIX . "invoices` DROP PRIMARY KEY, ADD PRIMARY KEY(`domain_id`,`id` );";
$patch['210']['date'] = "20090826";
$patch['211']['name'] = "Reset auto-increment for invoice table";
$patch['211']['patch'] = "ALTER TABLE `" . TB_PREFIX . "invoices` AUTO_INCREMENT = 1;";
$patch['211']['date'] = "20090826";
$patch['212']['name'] = "Copy invoice.id into invoice.index_id";
$patch['212']['patch'] = "update `" . TB_PREFIX . "invoices` set index_id = id;";
$patch['212']['date'] = "20090902";
$max_invoice = invoice::max();
$patch['213']['name'] = "Update the index table with max invoice id - if required";
if ($max_invoice > "0") {
$patch['213']['patch'] = "insert into `" . TB_PREFIX . "index` (id, node, sub_node, domain_id) VALUES (" . $max_invoice . ", 'invoice', '" . $defaults['preference'] . "','1');";
} else {
$patch['213']['patch'] = "select 1 from `" . TB_PREFIX . "index`;";
}
$patch['213']['date'] = "20090902";
unset($defaults);
unset($max_invoice);
$patch['214']['name'] = "Add sub_node_2 to si_index table";
$patch['214']['patch'] = "ALTER TABLE `" . TB_PREFIX . "index` ADD `sub_node_2` VARCHAR( 255 ) NULL AFTER `sub_node`";
$patch['214']['date'] = "20090912";
$patch['215']['name'] = "si_invoices - add composite primary key - patch removed";
#$patch['215']['patch'] = "ALTER TABLE `".TB_PREFIX."index` DROP PRIMARY KEY, ADD PRIMARY KEY(`domain_id`, `id`)";
#$patch['215']['patch'] = "ALTER TABLE `".TB_PREFIX."index` ADD PRIMARY KEY(`domain_id`, `id`)";