Prechádzať zdrojové kódy

verify Fixed db, query, and update on php-phalcon

Mike Smith 11 rokov pred
rodič
commit
e5e9b27b9e

+ 6 - 1
php-phalcon/app/controllers/BenchController.php

@@ -27,7 +27,12 @@ class BenchController extends \Phalcon\Mvc\Controller
             $worlds[] = Worlds::findFirst(mt_rand(1, 10000));
         }
 
-        return $this->sendContentAsJson($worlds);
+        if (count($worlds) == 1) {
+            return $this->sendContentAsJson($worlds[0]);
+        }
+        else {
+            return $this->sendContentAsJson($worlds);
+        }
     }
 
     public function fortunesAction() {