向表中 某字段的值做 "加"运算

@param string $table
@param string $field
@param int $incr
@param mixed $cond

@return int
336733
public function incr_field($table, $field, $incr = 1, $cond=null)
    {
    	return Sql::assistant( $this->ds )->incr_field($table, $field, $incr, $cond);
    }
917197
protected static function resolve_field($field, $table) {
        $prefix = constant(__CLASS__ . '::ALIAS_' . core_text::strtoupper($table));
        return sprintf('%s.%s', $prefix, $field);
    }
142340
public function addWhereFieldNotIn($field, array $values, $table = ''): self
    {
        if (!$table) {
            $table = $this->getDbTableName();
        }

        if (!$values) {
            $values = [NULL];
        }
        foreach ($values as $k => & $v) {
            $v = sql_prepare($v);
        }
        unset($v);

        $this->addWhereFieldAsString('`'. $table .'`.`'. $field .'` NOT IN ("'. implode('", "', $values) .'")');

        return $this;
    }
447645
public function tableHasField($table, $field)
    {
        return isset($this->cache['fields'][$table]) && array_key_exists($field, $this->cache['fields'][$table]);
    }
1193793
private function addColumn($field)
    {
        $syntax = sprintf("\$table->%s('%s')", $field['type'], $field['name']);

        // If there are arguments for the schema type, like decimal('amount', 5, 2)
        // then we have to remember to work those in.
        if ($field['arguments']) {
            $syntax = substr($syntax, 0, -1) . ', ';

            $syntax .= implode(', ', $field['arguments']) . ')';
        }

        foreach ($field['options'] as $method => $value) {
            $syntax .= sprintf("->%s(%s)", $method, $value === true ? '' : $value);
        }

        return $syntax .= ';';
    }
599390
public function hincrby($key, $field, $increment = 1)
    {
        $this->init();
        return $this->driver->hincrby($key, $field, (int)$increment);
    }
1233341
public function inc($table, $data, $condition)
    {
        $collection = $this->db->selectCollection($table);
        $result = $collection->update(
            MongoQueryBuilder::where($condition),
            array('$inc' => self::filterData($data)),
            $this->getOptions());

        return ($result['ok'] == 1 && $result['n'] > 0);
    }
798085
public function getBy($field, $cond = UNDEFINED, $value = UNDEFINED)
    {
        $data = $this->data;
        $id = $this->id;

        $this->tryLoadBy($field, $cond, $value);
        $row = $this->data;

        $this->data = $data;
        $this->id = $id;

        return $row;
    }
473198
public void add(CharRange cond)
    {
        if (set.isEmpty())
        {
            set.add(cond);
        }
        else
        {
            List<CharRange> remlist = new ArrayList<CharRange>();
            List<CharRange> addlist = new ArrayList<CharRange>();
            boolean is = false;
            for (CharRange r : set)
            {
                if (r.intersect(cond))
                {
                    remlist.add(r);
                    addlist.addAll(CharRange.removeOverlap(cond, r));
                    is = true;
                }
            }
            if (!is)
            {
                set.add(cond);
            }
            set.removeAll(remlist);
            set.addAll(addlist);
        }
    }
1314838
public function min($table, $field, $conditions = false)
    {
        return $this->executeAggregate('MIN', $table, $field, $conditions);
    }
1194350
protected <T> int updateField (
        final Table<T> table, final T object, String field)
        throws PersistenceException
    {
        final FieldMask mask = table.getFieldMask();
        mask.setModified(field);
        return executeUpdate(new Operation<Integer>() {
            public Integer invoke (Connection conn, DatabaseLiaison liaison)
                throws SQLException, PersistenceException
            {
                return table.update(conn, object, mask);
            }
        });
    }
538381
public function isFieldExists($table, $field)
	{
		if (isset($this->tables[$table])) {
			$fields = $this->getFields($table);

			return $fields->where('name', $field)->count() > 0;
		}

		return false;
	}
1079328
function addCount($key, $expire = 86400, $incrby = 1)
    {
        $key = self::PREFIX.$key;
        //增加计数
        if ($this->redis->exists($key))
        {
            return $this->redis->incr($key, $incrby);
        }
        //不存在的Key，设置为1
        else
        {
            return $this->redis->set($key, $incrby, $expire);
        }
    }
1140537
protected function _like(string $field, $val, string $pos, string $like='LIKE', string $conj='AND'): self
	{
		$field = $this->driver->quoteIdent($field);

		// Add the like string into the order map
		$like = $field. " {$like} ?";

		if ($pos === 'before')
		{
			$val = "%{$val}";
		}
		elseif ($pos === 'after')
		{
			$val = "{$val}%";
		}
		else
		{
			$val = "%{$val}%";
		}

		$conj = empty($this->state->getQueryMap()) ? ' WHERE ' : " {$conj} ";
		$this->state->appendMap($conj, $like, 'like');

		// Add to the values array
		$this->state->appendWhereValues($val);

		return $this;
	}
210408
public function in($item, array $list, $cond = null, $not = false)
    {
        $inClause = '';

        if (null == $this->oosql_where && null == $this->oosql_in && null == $this->oosql_between) {
            $inClause .= ' WHERE ';
        } else {
            $cnd = ' AND ';

            if (null != $cond) {

                if (strtolower($cond) == 'or') {
                    $cnd = ' OR ';
                }

            }
            $inClause .= $cnd;
        }
        if ($not) {
            $item = $item . ' NOT ';
        }
        $inClause .= $item . ' IN ';

        $obj = $this;

        $list = array_map(function ($data) use ($obj) {
            return (!$obj->validInt($data)) ? $obj->quote($data) : $data;
        }, $list);

        $inClause .= '(' . implode(',', $list) . ')';

        $this->oosql_in = $inClause;

        return $this;
    }
28998
public function add_field($field, $table, $alias = null) {
        $field = self::resolve_field($field, $table);
        if (!empty($alias)) {
            $field .= ' AS ' . $alias;
        }
        $this->fields[] = $field;
    }
964496
public function tryLoadBy($field, $cond = UNDEFINED, $value = UNDEFINED)
    {
        $q = $this->dsql;
        $this->dsql = $this->dsql();
        $this->addCondition($field, $cond, $value);
        $this->tryLoadAny();
        $this->dsql = $q;

        return $this;
    }