init
This commit is contained in:
11
modules/EcmPriceBooks/update_accounts_ecmproducts.php
Executable file
11
modules/EcmPriceBooks/update_accounts_ecmproducts.php
Executable file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
$w=$GLOBALS['db']->query("select id,account_id from ecmpricebooks where deleted='0'");
|
||||
while($r=$GLOBALS['db']->fetchByAssoc($w)){
|
||||
$ww=$GLOBALS['db']->query("select ecmproduct_id from ecmpricebooks_ecmproducts where deleted='0' and ecmpricebook_id='".$r['id']."'");
|
||||
while($rr=$GLOBALS['db']->fetchByAssoc($ww)){
|
||||
if(mysql_num_rows($GLOBALS['db']->query("select id from accounts_ecmproducts where account_id='".$r['account_id']."' and ecmproduct_id='".$rr['ecmproduct_id']."' and deleted='0'"))==0){
|
||||
$GLOBALS['db']->query("insert into accounts_ecmproducts set id='".create_guid()."',account_id='".$r['account_id']."',ecmproduct_id='".$rr['ecmproduct_id']."',date_modified='".date("Y-m-d H:i:s")."',deleted='0'");
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user