1
This commit is contained in:
@@ -18,6 +18,12 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property int $status 状态(0:禁用 1:正常 2:删除)
|
||||
* @property int $is_online 是否在线(0:不在线 1:在线)
|
||||
* @property string $avatar 头像
|
||||
* @property int $pharmacist_title 职称
|
||||
* @property int $department_custom_id 科室id-自定义
|
||||
* @property string $department_custom_name 科室名称(如未自己输入,填入标准科室名称)
|
||||
* @property string $department_custom_mobile 科室电话
|
||||
* @property string $medical_institution 医疗机构名称
|
||||
* @property string $worker_date 医龄
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
*/
|
||||
@@ -33,12 +39,7 @@ class UserPharmacist extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['pharmacist_id', 'user_id', 'user_name', 'open_id', 'union_id', 'wx_session_key', 'status', 'is_online', 'avatar', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['pharmacist_id' => 'integer', 'user_id' => 'integer', 'status' => 'integer', 'sex' => 'integer', 'age' => 'integer', 'is_online' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
protected array $fillable = ['pharmacist_id', 'user_id', 'user_name', 'open_id', 'union_id', 'wx_session_key', 'status', 'is_online', 'avatar', 'pharmacist_title', 'department_custom_id', 'department_custom_name', 'department_custom_mobile', 'medical_institution', 'worker_date', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "pharmacist_id";
|
||||
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
<?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 $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', '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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user