新增系统问诊时间模型、修正问诊配置
This commit is contained in:
@@ -10,16 +10,14 @@ use Hyperf\Database\Model\Relations\HasOne;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $inquiry_config_id 主键id
|
||||
* @property int $doctor_id 医生id
|
||||
* @property int $system_inquiry_config_id 系统问诊配置表id
|
||||
* @property string $inquiry_config_id 主键id
|
||||
* @property string $doctor_id 医生id
|
||||
* @property int $inquiry_type 接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
|
||||
* @property int $inquiry_mode 接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
|
||||
* @property int $work_num_day 每日接诊数量
|
||||
* @property string $inquiry_price 接诊价格(专家问诊-公益问诊)
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
* @property-read SystemInquiryConfig $SystemInquiryConfig
|
||||
*/
|
||||
class DoctorInquiryConfig extends Model
|
||||
{
|
||||
@@ -33,23 +31,15 @@ class DoctorInquiryConfig extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['inquiry_config_id', 'doctor_id', 'system_inquiry_config_id', 'inquiry_type', 'inquiry_mode', 'work_num_day', 'inquiry_price', 'created_at', 'updated_at'];
|
||||
protected array $fillable = ['inquiry_config_id', 'doctor_id', 'inquiry_type', 'inquiry_mode', 'work_num_day', 'inquiry_price', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['inquiry_config_id' => 'integer', 'doctor_id' => 'integer', 'system_inquiry_config_id' => 'integer', 'inquiry_type' => 'integer', 'inquiry_mode' => 'integer', 'work_num_day' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
protected array $casts = ['inquiry_config_id' => 'string', 'doctor_id' => 'string', 'inquiry_type' => 'integer', 'inquiry_mode' => 'integer', 'work_num_day' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
|
||||
protected string $primaryKey = "inquiry_config_id";
|
||||
|
||||
/**
|
||||
* 关联系统问诊配置表
|
||||
*/
|
||||
public function SystemInquiryConfig(): HasOne
|
||||
{
|
||||
return $this->hasOne(SystemInquiryConfig::class, 'system_inquiry_config_id', 'system_inquiry_config_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生接诊配置信息-单条
|
||||
* @param array $params
|
||||
@@ -69,7 +59,7 @@ class DoctorInquiryConfig extends Model
|
||||
*/
|
||||
public static function getInquiryConfigOne(array $params, array $fields = ['*']): object|null
|
||||
{
|
||||
return self::with(['SystemInquiryConfig'])->where($params)->first($fields);
|
||||
return self::where($params)->first($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,8 +71,7 @@ class DoctorInquiryConfig extends Model
|
||||
*/
|
||||
public static function getInquiryConfigList(array $params, array $fields = ['*']): object|null
|
||||
{
|
||||
return self::with(['SystemInquiryConfig'])
|
||||
->where($params)->whereIn("inquiry_type",[1,3])->get($fields);
|
||||
return self::where($params)->whereIn("inquiry_type",[1,3])->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user