Changeset 688 for trunk/Common/Setup/Updates.php
- Timestamp:
- Sep 7, 2014, 2:48:21 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Setup/Updates.php
r679 r688 885 885 } 886 886 887 function UpdateTo688($Manager) 888 { 889 // Convert monthly plus payment for consumption to regular service 890 $DbResult = $Manager->Execute('SELECT `MonthlyPlus`, `Member` FROM `MemberPayment` WHERE `MonthlyPlus` > 0'); 891 while($DbResult->num_rows > 0) 892 { 893 $DbRow = $DbResult->fetch_assoc(); 894 $Manager->Execute("INSERT INTO `Service` (`Id` ,`Name` ,`Category` ,`Price` ,`VAT`) ". 895 "VALUES (NULL , 'Spotřeba energie', 3, -".$DbRow['MonthlyPlus'].", 2);"); 896 $ServiceId = $Manager->Database->insert_id; 897 $Manager->Execute("INSERT INTO `ServiceCustomerRel` (`Id` ,`Service` ,`Customer`) ". 898 "VALUES (NULL , ".$ServiceId.', '.$DbRow['Member'].");"); 899 } 900 } 901 887 902 class Updates 888 903 { … … 933 948 676 => array('Revision' => 678, 'Function' => 'UpdateTo678'), 934 949 678 => array('Revision' => 679, 'Function' => 'UpdateTo679'), 950 679 => array('Revision' => 688, 'Function' => 'UpdateTo688'), 935 951 )); 936 952 }
Note:
See TracChangeset
for help on using the changeset viewer.