mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-22 03:32:47 +08:00
25 lines
526 B
PHP
25 lines
526 B
PHP
<?php
|
|
|
|
namespace App\Repos;
|
|
|
|
use App\Models\UserSession as UserSessionModel;
|
|
use Phalcon\Mvc\Model\Resultset;
|
|
use Phalcon\Mvc\Model\ResultsetInterface;
|
|
|
|
class UserSession extends Repository
|
|
{
|
|
|
|
/**
|
|
* @param int $userId
|
|
* @return ResultsetInterface|Resultset|UserSessionModel[]
|
|
*/
|
|
public function findByUserId($userId)
|
|
{
|
|
return UserSessionModel::query()
|
|
->where('user_id = :user_id:', ['user_id' => $userId])
|
|
->andWhere('deleted = 0')
|
|
->execute();
|
|
}
|
|
|
|
}
|