OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)
This commit is contained in:
27
app/Domain/Api/Repositories/Api.php
Normal file
27
app/Domain/Api/Repositories/Api.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Leantime\Domain\Api\Repositories;
|
||||
|
||||
use Illuminate\Database\ConnectionInterface;
|
||||
use Leantime\Core\Db\Db as DbCore;
|
||||
|
||||
class Api
|
||||
{
|
||||
private ConnectionInterface $db;
|
||||
|
||||
public function __construct(DbCore $db)
|
||||
{
|
||||
$this->db = $db->getConnection();
|
||||
}
|
||||
|
||||
public function getAPIKeyUser(string $apiKeyUser): mixed
|
||||
{
|
||||
$result = $this->db->table('zp_user')
|
||||
->where('username', $apiKeyUser)
|
||||
->where('source', 'api')
|
||||
->limit(1)
|
||||
->first();
|
||||
|
||||
return $result ? (array) $result : false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user