feat: add smt module
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\smt\model;
|
||||
|
||||
class User extends BaseBizModel
|
||||
{
|
||||
protected $name = 'users';
|
||||
|
||||
protected $pk = 'id';
|
||||
|
||||
public static function findBySessionKey(string $sessionKey): ?self
|
||||
{
|
||||
return self::where('session_key', $sessionKey)->whereNull('deleted_at')->find();
|
||||
}
|
||||
|
||||
public static function findActiveById(int $id): ?self
|
||||
{
|
||||
return self::where('id', $id)->whereNull('deleted_at')->find();
|
||||
}
|
||||
|
||||
public static function findByMiniProgramOpenId(int $miniProgramId, string $openId): ?self
|
||||
{
|
||||
return self::where('mini_program_id', $miniProgramId)
|
||||
->where('open_id', $openId)
|
||||
->whereNull('deleted_at')
|
||||
->find();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user