39 lines
609 B
PHP
39 lines
609 B
PHP
<?php
|
|
|
|
|
|
|
|
namespace app\common\model\user;
|
|
|
|
use app\common\model\BaseModel;
|
|
|
|
class UserExtract extends BaseModel
|
|
{
|
|
|
|
public static function tablePk(): ?string
|
|
{
|
|
return 'extract_id';
|
|
}
|
|
|
|
public static function tableName(): string
|
|
{
|
|
return 'user_extract';
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->hasOne(User::class,'uid','uid');
|
|
}
|
|
|
|
public function searchUidAttr($query, $value)
|
|
{
|
|
$query->where('uid',$value);
|
|
}
|
|
|
|
public function searchExtractTypeAttr($query, $value)
|
|
{
|
|
$query->where('extract_type',$value);
|
|
}
|
|
|
|
|
|
}
|