当前位置: 首页>>代码示例>>PHP>>正文


PHP invoice::max方法代码示例

本文整理汇总了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`)";
开发者ID:simpleinvoices2,项目名称:simpleinvoices,代码行数:31,代码来源:sql_patches.php

示例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`)";
开发者ID:alachaum,项目名称:simpleinvoices,代码行数:31,代码来源:sql_patches.php


注:本文中的invoice::max方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。