]> git.nbdom.net Git - nb.git/commitdiff
fix bug for extras
authorDevops <sys@15gifts.com>
Tue, 30 May 2017 11:09:01 +0000 (12:09 +0100)
committerDevops <sys@15gifts.com>
Tue, 30 May 2017 11:09:01 +0000 (12:09 +0100)
lib/php/db/table.php

index bfa963e32d77033953e17ecff856ede086804125..1041a255133d534e9501db4e9afc22053373d4ef 100644 (file)
@@ -752,6 +752,8 @@ Class Table extends nb {
       # having, denorm, EMPTY
       if ($field->extras) {
         $extra_where = (string)$this->db()->conf_type('extra_where');
+    #if ($_SERVER['REMOTE_USER'] == 'nico') debug($sql);
+        $k = $field->extras;
         if ($extra_where == 'having') {
           $having[] = "$k$equal$v";
         } else {
@@ -772,10 +774,6 @@ Class Table extends nb {
 
   public function add_extras($extras) {
     if ($this->p('extras') === '0') return false;
-    #return false;
-
-    # Test if type exists because of a bug from shell.php
-# NB 30.08.16     if ($this->db()->conf_type('type')) $this->fields();
 
     foreach ($extras as $k => $v) {
 
@@ -1903,7 +1901,7 @@ Class Table extends nb {
   public function err_sql($sql) {
     $err = $this->db()->conn->errorInfo();
     $err[] = $sql;
-    self::bye(join(' | ',$err));
+    $this->bye(join(' | ',$err));
   }
 
   public function html_menu($opt=[]) {