當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。