Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $contacts = ConnectionFactory::getConnection('content')->select('select * from IS_ContactSelect(1000)');
- if (count($contacts) > 0) {
- $ct = ConnectionFactory::getConnection('cabinetct');
- $ct->transaction();
- try {
- foreach ($contacts as $contact) {
- $ct->query('delete from ct_contact where id = ?d', $contact['ID']);
- $cabinet->query('insert into ?_contacts set ?a', array(
- 'id' => $contact['ID'],
- 'id_group' => $contact['ID_GROUP'],
- 'id_token' => $contact['ID_TOKEN'],
- 'id_fio' => $contact['ID_FIO'],
- 'id_div' => $contact['ID_DIV'],
- 'id_divs' => $contact['ID_DIVS'],
- 'name_fio' => $contact['NAME_FIO'],
- 'name_div' => $contact['NAME_DIV'],
- 'name_divs' => $contact['NAME_DIVS'],
- 'name_staf' => $contact['NAME_STAF'],
- 'kind' => $contact['KIND'],
- 'place' => $contact['PLACE'],
- 'contact' => $contact['CONTACT']
- ));
- }
- $ct->commit();
- } catch (Exception $e) {
- $ct->rollback();
- throw $e;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement