function filter($filter) { $addons = array(); if (isset($filter['installed'])) { $addons[] = $filter['installed'] ? 'status!="uninstalled"' : 'status="uninstalled"'; unset($filter['installed']); } $addons = implode(' AND ', $addons); if ($addons) { $addons .= ' AND '; } return $addons . parent::filter($filter); }
public function getList($cols = '*', $filter = array(), $offset = 0, $limit = -1, $orderby = null) { if ($orderby) { $orderby .= ", calltime DESC"; } else { $orderby = "calltime DESC"; } $rpc_lists = parent::getList($cols, $filter, $offset, $limit, $orderby); if ($rpc_lists) { foreach ($rpc_lists as &$rpc_info) { if ($rpc_info['result']) { $rpc_info['result'] = unserialize($rpc_info['result']); if ($rpc_info['result']) { $rpc_info['result'] = "rsp:" . $rpc_info['result']['rsp'] . ", msg_id:" . $rpc_info['result']['msg_id'] . ", res:" . $rpc_info['result']['res']; } } } } return $rpc_lists; }
function filter($filter) { $addons = array(); if (isset($filter['installed'])) { $addons[] = $filter['installed'] ? 'status!="uninstalled"' : 'status="uninstalled"'; unset($filter['installed']); } if (isset($filter['normalview'])) { //普通用户浏览模式 $hidden_apps = true; $hidden_app_ids = $this->get_hidden_app_ids(); if (count($hidden_app_ids)) { $addons[] = "`app_id` NOT IN ('" . join("', '", $hidden_app_ids) . "')"; } //todo: 隐藏信赖app信息 } $addons = implode(' AND ', $addons); if ($addons) { $addons .= ' AND '; } unset($filter['normalview']); return $addons . parent::filter($filter); }
function filter($filter) { $addons = array(); if (isset($filter['installed'])) { $addons[] = $filter['installed'] ? 'status!="uninstalled"' : 'status="uninstalled"'; unset($filter['installed']); } if (isset($filter['normalview'])) { //普通用户浏览模式 $hidden_apps = true; if ($service = kernel::service('base_mdl_apps_hidden')) { if (method_exists($service, 'is_hidden')) { $hidden_apps = $service->is_hidden($filter); } } if ($hidden_apps === true) { $depends_apps = array_keys($this->check_deploy_depends()); $package = $this->fetch_deploy_package(); $package_apps = array(); foreach ($package as $package_app) { $package_apps[] = $package_app['id']; } $diff_apps = array_diff($depends_apps, $package_apps); if (count($diff_apps)) { $addons[] = "`app_id` NOT IN ('" . join("', '", $diff_apps) . "')"; } //todo: 隐藏信赖app信息 } //todo:判断是否需要隐藏app } unset($filter['normalview']); $addons = implode(' AND ', $addons); if ($addons) { $addons .= ' AND '; } return $addons . parent::filter($filter); }
public function update($data, $filter, $mustUpdate = null) { if ($this->use_meta) { $pk = $this->get_pk_list($filter); foreach ($this->metaColumn as $col) { if (!in_array($col, array_keys($data))) { continue; } $obj_meta = new dbeav_meta($this->table_name(true), $col); $obj_meta->update($data[$col], $pk); unset($data[$col]); } } return parent::update($data, $this->_filter($filter), $mustUpdate); }
function save(&$data, $mustUpdate = null) { $return = parent::save($data, $mustUpdate); }
function filter($filter) { unset($filter['use_like']); return parent::filter($filter); }
public function save(&$column, $mustUpdate = null, $mustInsert = false) { $this->col_desc = $column['col_desc']; $column['col_type'] = $this->get_col_type(); return parent::save($column); }
function __construct($app) { parent::__construct($app); $this->db->exec('set SESSION autocommit=1;'); $this->db->exec('set @msgID = -1;'); }
/** * 处理finder搜索相关的filter * * @param string|array $filter * @param base_db_model $object * @return array */ private function processSearchFilter(&$filter, $object) { $newFilter = []; $cols = $object->_columns(); $searchOptions = $object->searchOptions(); foreach ($filter as $columnName => $filterValue) { if (isset($cols[$columnName])) { switch ($cols[$columnName]['type']) { case 'time': case 'last_modify': if ($filter['_' . $columnName . '_search'] == 'between') { if ($filter[$columnName . '_from']) { $fromTime = strtotime($filter[$columnName . '_from'] . ' ' . $filter['_DTIME_']['H'][$columnName . '_from'] . ':' . $filter['_DTIME_']['M'][$columnName . '_from'] . ':00'); $newFilter[$columnName . '|bthan'] = $fromTime; } if ($filter[$columnName . '_to']) { $toTime = strtotime($filter[$columnName . '_to'] . ' ' . $filter['_DTIME_']['H'][$columnName . '_to'] . ':' . $filter['_DTIME_']['M'][$columnName . '_to'] . ':00'); $newFilter[$columnName . '|lthan'] = $toTime; } } else { $time = strtotime($filter[$columnName] . ' ' . $filter['_DTIME_']['H'][$columnName] . ':' . $filter['_DTIME_']['M'][$columnName] . ':00'); $newFilter[$columnName . '|' . $filter['_' . $columnName . '_search']] = $time; } break; case 'money': case 'number': case 'decimal': case 'integer': case 'smallint': if ($filter['_' . $columnName . '_search'] == 'between') { if ($from = $filter[$columnName . '_from']) { $newFilter[$columnName . '|bthan'] = $from; } if ($to = $filter[$columnName . '_to']) { $newFilter[$columnName . '|lthan'] = $to; } } elseif (isset($filter['_' . $columnName . '_search'])) { $newFilter[$columnName . '|' . $filter['_' . $columnName . '_search']] = $filterValue; } else { $newFilter[$columnName] = $filterValue; } break; default: case isset($cols[$columnName]['filtertype']) && isset($filter['_' . $columnName . '_search']): $newFilter[$columnName . '|' . $filter['_' . $columnName . '_search']] = $filterValue; unset($filter[$columnName]); case isset($cols[$columnName]['searchtype']): $newFilter[$columnName . '|' . $cols[$columnName]['searchtype']] = $filterValue; // todo: 因为searchOption unset($filter[$columnName]); break; default: $newFilter[$columnName] = $filterValue; break; } } elseif (strpos($cols[$columnName], '|')) { $newFilter[$columnName] = $cols[$columnName]; } elseif (isset($searchOptions[$columnName])) { $newFilter[$columnName] = $filterValue; break; } } $filter = $newFilter; }
public function save(&$data, $mustUpdate = null, $mustInsert = false) { $return = parent::save($data, $mustUpdate); }
/** * 更新数据 * * @param array $data * @param array $filter * @param misc $mustUpdate * * @return string */ public function update($data, $filter = array(), $mustUpdate = null) { return parent::update($data, $filter, $mustUpdate); }
function save($column) { $this->col_desc = $column['col_desc']; $column['col_type'] = $this->get_col_type(); return parent::save($column); }