81 lines
2.5 KiB
PHP
81 lines
2.5 KiB
PHP
<?php
|
||
|
||
declare(strict_types=1);
|
||
|
||
namespace App\Model;
|
||
|
||
|
||
|
||
use Hyperf\Database\Model\Collection;
|
||
use Hyperf\Snowflake\Concern\Snowflake;
|
||
|
||
/**
|
||
* @property int $info_id 主键id
|
||
* @property int $user_id 用户id
|
||
* @property int $pharmacist_id 药师id
|
||
* @property int $card_type 类型(1:身份证 2:护照 3:港澳通行证 4:台胞证)
|
||
* @property string $card_name 证件姓名
|
||
* @property string $card_name_mask 证件姓名(掩码)
|
||
* @property string $card_num 证件号码
|
||
* @property string $card_num_mask 证件号码(掩码)
|
||
* @property string $license_cert 医师执业证(逗号分隔)
|
||
* @property string $qualification_cert 医师资格证(逗号分隔)
|
||
* @property string $qualification_cert_num 医师资格证号(逗号分隔)
|
||
* @property string $work_cert 医师工作证(逗号分隔)
|
||
* @property string $multi_point_images 多点执业备案信息(逗号分隔)
|
||
* @property string $id_card_front 身份证正面图片
|
||
* @property string $id_card_back 身份证背面图片
|
||
* @property string $sign_image 签名图片
|
||
* @property \Carbon\Carbon $created_at 创建时间
|
||
* @property \Carbon\Carbon $updated_at 修改时间
|
||
*/
|
||
class UserPharmacistInfo extends Model
|
||
{
|
||
use Snowflake;
|
||
|
||
/**
|
||
* The table associated with the model.
|
||
*/
|
||
protected ?string $table = 'user_pharmacist_info';
|
||
|
||
/**
|
||
* The attributes that are mass assignable.
|
||
*/
|
||
protected array $fillable = ['info_id', 'user_id', 'pharmacist_id', 'card_type', 'card_name', 'card_name_mask', 'card_num', 'card_num_mask', 'license_cert', 'qualification_cert', 'qualification_cert_num', 'work_cert', 'multi_point_images', 'id_card_front', 'id_card_back', 'sign_image', 'created_at', 'updated_at'];
|
||
|
||
protected string $primaryKey = "info_id";
|
||
|
||
/**
|
||
* 获取是否存在
|
||
* @param array $params
|
||
* @return bool
|
||
*/
|
||
public static function getExists(array $params): bool
|
||
{
|
||
return self::where($params)->exists();
|
||
}
|
||
|
||
/**
|
||
* 获取信息-单条
|
||
* @param array $params
|
||
* @param array $fields
|
||
* @return object|null
|
||
*/
|
||
public static function getOne(array $params, array $fields = ['*']): object|null
|
||
{
|
||
return self::where($params)->first($fields);
|
||
}
|
||
|
||
/**
|
||
* 获取数据-多
|
||
* @param array $params
|
||
* @param array $fields
|
||
* @return Collection|array
|
||
*/
|
||
public static function getList(array $params = [], array $fields = ['*']): Collection|array
|
||
{
|
||
return self::where($params)->get($fields);
|
||
}
|
||
|
||
}
|