fix Target Class: getMaterialUrl no data bug

This commit is contained in:
Yuan Chiu 2015-01-20 02:46:35 +08:00
parent 76476de02f
commit de70a40b37

View File

@ -198,8 +198,9 @@ class Target {
$db = new Database\DBMaterial();
$query = $db->queryAllMaterialByTargetId($this->tId);
foreach($query as $thisData) {
if(count($query) > 0) {
foreach($query as $thisData) {
if($thisData['is_entity'] != 0) {
$thisEntiry = true;
}
@ -210,9 +211,11 @@ class Target {
break;
}
}
}
else {
return null;
}
}
// ========================================================================