新增医生问诊配置相关接口

This commit is contained in:
2024-01-02 14:00:47 +08:00
parent 4d5db7760a
commit b53b0204cf
7 changed files with 528 additions and 103 deletions
+81
View File
@@ -0,0 +1,81 @@
<?php
declare(strict_types=1);
namespace App\Model;
use Hyperf\Snowflake\Concern\Snowflake;
/**
* @property int $config_service_id 主键id
* @property int $doctor_id 医生id
* @property int $inquiry_type 接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
* @property int $inquiry_mode 接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
* @property string $service_content 服务内容
* @property string $service_process 服务流程
* @property int $service_period 服务周期
* @property int $service_rounds 服务回合数
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间
*/
class DoctorInquiryConfigService extends Model
{
use Snowflake;
/**
* The table associated with the model.
*/
protected ?string $table = 'doctor_inquiry_config_service';
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['config_service_id', 'doctor_id', 'inquiry_type', 'inquiry_mode', 'service_content', 'service_process', 'service_period', 'service_rounds', 'created_at', 'updated_at'];
protected string $primaryKey = "config_service_id";
/**
* 获取信息-单条
* @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 object|null
*/
public static function getList(array $params, array $fields = ['*']): object|null
{
return self::where($params)->get($fields);
}
/**
* 新增
* @param array $data
* @return DoctorInquiryConfigService|\Hyperf\Database\Model\Model
*/
public static function addDoctorInquiryConfigService(array $data): \Hyperf\Database\Model\Model|DoctorInquiryConfigService
{
return self::create($data);
}
/**
* 修改
* @param array $params
* @param array $data
* @return int
*/
public static function edit(array $params = [], array $data = []): int
{
return self::where($params)->update($data);
}
}