static function load($group = '', $mode = 'Demand') { $sql = 'SELECT `group`, `name`, `content` FROM `' . self::fmTbl() . '`'; $condition = ' WHERE `status`=? AND `loader` = ? '; $params = array(self::ST_ON, $mode); if ($group != '') { $condition .= ' AND `group` = ? '; $params[] = $group; } $rows = db()->exec($sql . $condition, parent::_fixAry($params)); $options = array(); foreach ($rows as $row) { if ($group != '') { $options[$row['name']] = $row['content']; } else { $options[$row['group']][$row['name']] = $row['content']; } } return $options; }
static function update_sorter($pid, $value) { db()->exec("UPDATE `" . self::fmTbl() . "` SET `sorter`=? WHERE `id`=?", parent::_fixAry(array($value, $pid))); }