获取mysql中师傅表最大的id.
@return int  id
347284
public function getMaxId()
    {

        try {
            $result = app('db')->connection('mysql')->select("select max(id) maxid from " . config("database.mysql_workers"));

        } catch (\Exception $e) {
            Log::info('c=CopydataApiController f=getMaxId  msg=' . $e->getMessage());
            return false;
        }

        $max = $result[0]->maxid;
        return (int)$max;
    }
503698
protected function insert_id()
    {
        $query = $this->database->getQueryCollection()->findQuery($this->strQuery);

        if ($query) {
            return $query->result()->getRow($query->result()->count());
        }

        return null;
    }
85192
public function count()
    {
        $myQuery = clone $this->query;

        if (!Str::contains(Str::lower($myQuery->toSql()), ['union', 'having', 'distinct', 'order by', 'group by'])) {
            $row_count = $this->connection->getQueryGrammar()->wrap('row_count');
            $myQuery->select($this->connection->raw("'1' as {$row_count}"));
        }
        return $this->connection->table($this->connection->raw('(' . $myQuery->toSql() . ') count_row_table'))
                        ->setBindings($myQuery->getBindings())->count();
    }
197668
protected function generateConnectionId()
    {
        $max_unsigned_int = 4294967295;
        if (self::$_connectionIdRecorder >= $max_unsigned_int) {
            self::$_connectionIdRecorder = 0;
        }
        while(++self::$_connectionIdRecorder <= $max_unsigned_int) {
            if(!isset($this->_clientConnections[self::$_connectionIdRecorder])) {
                break;
            }
        }
        return self::$_connectionIdRecorder;
    }
723022
protected function uniqId()
    {
        $exists = true;

        while ($exists) {
            $key = $this->generateKey();
            $exists = $this->find()->where(['id' => $key])->first();
        }

        return $key;
    }
778367
public function getId()
    {
        if (!isset($this->attributes['id'])) {
            $this->buildIdAttr(Container::getRequest()->getParam(self::AI_KEY));
        }
        return $this->attributes['id'];
    }
124659
public function getId()
    {
        $id = $this->props['attribs']['id'];
        $sepChar = '_'; // character to join prefix and id
        $repChar = '_'; // replace \W with this char
        if (!$id && $this->props['attribs']['name']) {
            $id = \preg_replace('/\W/', $repChar, $this->props['attribs']['name']);
            $id = \preg_replace('/'.$repChar.'+/', $repChar, $id);
            $id = \trim($id, $repChar);
            if ($id && $this->props['idPrefix']) {
                $prefix = $this->props['idPrefix'];
                if (\preg_match('/[a-z]$/i', $prefix)) {
                    $prefix = $prefix.$sepChar;
                }
                $id = $prefix.$id;
            }
            if ($id) {
                $this->props['attribs']['id'] = $id;
            }
        }
        return $id;
    }
510936
final public function getId() {
		
		$ids = array();
			
		foreach ($this->keyProperties as $propertyName) {
			$ids[] = $this->{$propertyName};
		}
		
		return (static::hasCompoundKey() ? $ids : $ids[0]);
		
	}
496475
public function id() : string
    {
        $name = $this->name();
        $name = preg_replace("@\[\]$@", '', $name);
        if ($name) {
            return $name.'-'.$this->value;
        }
        return $name;
    }
166368
public function getSql() {
        $sql = "CREATE TABLE IF NOT EXISTS {$this->getTable()} (";
        $column = $this->_data;
        if (!empty($this->primaryKey)) {
            $column[] = "PRIMARY KEY (`{$this->primaryKey}`)";
        }
        foreach ($this->checks as $key => $item) {
            $column[] = (!is_integer($key) ? "CONSTRAINT `{$key}` " : null)." CHECK ({$item})";
        }
        foreach ($this->index as $key => $item) {
            $column[] = (count($item) > 2 ? 'UNIQUE ': null). "INDEX `{$key}` (`{$item[0]}` {$item['1']})";
        }
        foreach ($this->foreignKey as $key => $item) {
            $column[] = "CONSTRAINT `{$key}` FOREIGN KEY (`{$item[0]}`) REFERENCES `{$item[1]}` (`{$item[2]}`) ON DELETE {$item[2]} ON UPDATE {$item[3]}";
        }
        $sql .= implode(',', $column).") ENGINE={$this->engine}";
        if ($this->aiBegin > 1) {
            $sql .= ' AUTO_INCREMENT='.$this->aiBegin;
        }
        return $sql." DEFAULT CHARSET={$this->charset} COMMENT='{$this->comment}';";
    }
472143
public function getId()
    {
        if (!$this->id) {
            $this->setId(sha1($this->getDomain() . $this->getKey()));
        }

        return $this->id;
    }
268471
public function id() : string
    {
        $id = $this->name();
        if ($this->prefix) {
            $id = implode('-', $this->prefix)."-$id";
        }
        $id = preg_replace('/[\W]+/', '-', $id);
        return trim(preg_replace('/[-]+/', '-', $id), '-');
    }
439294
public static function getKeyIndex(): int
    {
        if (self::$keyIndex == PHP_INT_MAX) {
            self::$keyIndex = 0;
        } else {
            self::$keyIndex++;
        }

        return self::$keyIndex;
    }
549321
protected function getCatID()
    {
        $objBannerCatID = \Database::getInstance()->prepare("SELECT 
                                                                MIN(pid) AS ID 
                                                             FROM 
                                                                tl_banner")
                                                  ->execute();
        $objBannerCatID->next();
        if ($objBannerCatID->ID === null)
        {
            return 0;
        }
        else
        {
            return $objBannerCatID->ID;
        }
    }
650008
public function getId()
    {
        return base64_encode($this->path . implode('', $this->parameters) . implode('', $this->body) . $this->method);
    }
324339
private function getSearchQueryId()
    {
        $queryId = null;

        if ($this->searchContext->getCurrentSearchQuery()) {
            $queryId = $this->searchContext->getCurrentSearchQuery()->getId();
        }

        return $queryId;
    }
195723
public function getNextId()
    {
        // remove any order prefixes from the last increment id
        $last = $this->_orderHelper->removeOrderIncrementPrefix($this->getLastId());
        // Using bcmath to avoid float/integer overflow.
        return $this->format(bcadd($last, 1));
    }