[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [12521] property: update external sync, typo
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [12521] property: update external sync, typo |
Date: |
Fri, 02 Jan 2015 15:29:43 +0000 |
Revision: 12521
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12521
Author: sigurdne
Date: 2015-01-02 15:29:43 +0000 (Fri, 02 Jan 2015)
Log Message:
-----------
property: update external sync, typo
Modified Paths:
--------------
trunk/property/inc/cron/default/synkroniser_med_boei.php
Modified: trunk/property/inc/cron/default/synkroniser_med_boei.php
===================================================================
--- trunk/property/inc/cron/default/synkroniser_med_boei.php 2015-01-02
14:07:51 UTC (rev 12520)
+++ trunk/property/inc/cron/default/synkroniser_med_boei.php 2015-01-02
15:29:43 UTC (rev 12521)
@@ -1144,11 +1144,11 @@
function update_obskode()
{
- $sql = "SELECT boei_leietaker.leietaker_id,
boei_leietaker.obskode FROM boei_leietaker"
+ $sql = "SELECT DISTINCT boei_leietaker.leietaker_id as
tenant_id, boei_leietaker.obskode FROM boei_leietaker"
. " JOIN fm_location4 ON boei_leietaker.leietaker_id =
fm_location4.tenant_id"
- . " WHERE boei_leietaker.obskode !=
fm_location4.obskode OR"
+ . " WHERE fm_location4.tenant_id > 0 AND
(boei_leietaker.obskode != fm_location4.obskode OR"
. " (boei_leietaker.obskode IS NULL AND
fm_location4.obskode IS NOT NULL) OR"
- . " (boei_leietaker.obskode IS NOT NULL AND
fm_location4.obskode IS NULL)";
+ . " (boei_leietaker.obskode IS NOT NULL AND
fm_location4.obskode IS NULL))";
$this->db->query($sql,__LINE__,__FILE__);
@@ -1157,15 +1157,15 @@
{
$obskoder[] = array
(
- 'tenant_id' =>
(int)$this->db->f('leietaker_id'),
+ 'tenant_id' =>
(int)$this->db->f('tenant_id'),
'obskode' =>
$this->db->f('obskode')
);
}
-
foreach($obskoder as $entry)
{
- $sql2 = "UPDATE fm_location4 SET obskode =
'{$entry['obskode']}"
- . " WHERE tenant_id = {$entry['leietaker_id']}";
+ $sql2 = "UPDATE fm_location4 SET obskode =
'{$entry['obskode']}'"
+ . " WHERE tenant_id = {$entry['tenant_id']}";
+
$this->db2->query($sql2,__LINE__,__FILE__);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [12521] property: update external sync, typo,
Sigurd Nes <=