$value) { if (property_exists(get_called_class(), $field)) { if (substr($field, 0, 5) == "vlan_" && !$value) { $model->$field = null; continue; } $model->$field = $value; } } $me = mfValuecache::singleton()->get("me"); if (!$me) { $me = new User(); $me->loadMe(); mfValuecache::singleton()->set("me", $me); } if ($model->create_by === null) { $model->create_by = $me->id; } if ($model->edit_by === null) { $model->edit_by = $me->id; } return $model; } public static function getpoprackmodule($poprack_id) { $items = []; $db = FronkDB::singleton(); $sql = "SELECT `id`, `name`, `start_he`,`end_he`,`plug`,`ports` FROM `Poprackmodule` WHERE `poprack_id`='" . $poprack_id . "' AND type ='0' ORDER by start_he"; $res = $db->query($sql); if ($db->num_rows($res)) { while ($data = $db->fetch_array($res)) { $items[] = $data; } $response['data'] = $items; $response['success'] = true; } else { $response['success'] = false; } echo json_encode($response); exit; } }