新增分配医生队列
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Database\Model\Model;
|
||||
use Hyperf\Database\Model\Relations\HasOne;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $inquiry_time_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 $inquiry_date 日期(可为空)
|
||||
* @property string $start_time 开始时间
|
||||
* @property string $end_time 结束时间
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
*/
|
||||
class DoctorInquiryTime extends Model
|
||||
{
|
||||
use Snowflake;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'doctor_inquiry_time';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['inquiry_time_id', 'doctor_id', 'inquiry_type', 'inquiry_mode', 'inquiry_date', 'start_time', 'end_time', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "inquiry_time_id";
|
||||
|
||||
/**
|
||||
* 关联医生表
|
||||
*/
|
||||
public function UserDoctor(): HasOne
|
||||
{
|
||||
return $this->hasOne(UserDoctor::class, 'doctor_id','doctor_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 Collection|array
|
||||
*/
|
||||
public static function getList(array $params = [], array $fields = ['*']): Collection|array
|
||||
{
|
||||
return self::where($params)->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取是否存在
|
||||
* @param array $params
|
||||
* @return bool
|
||||
*/
|
||||
public static function getExists(array $params): bool
|
||||
{
|
||||
return self::where($params)->exists();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据-单
|
||||
* 关联医生表
|
||||
* @param array $params
|
||||
* @param array $user_doctor_params
|
||||
* @param array $fields
|
||||
* @return array|Collection
|
||||
*/
|
||||
public static function getWithDoctorList(array $params = [],array $user_doctor_params = [], array $fields = ['*']): array|Collection
|
||||
{
|
||||
return self::whereHas('UserDoctor' , function($query) use ($user_doctor_params){
|
||||
$query->where($user_doctor_params);
|
||||
})
|
||||
->where($params)
|
||||
->get($fields);
|
||||
}
|
||||
|
||||
}
|
||||
+10
-12
@@ -8,22 +8,24 @@ namespace App\Model;
|
||||
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Database\Model\Relations\HasOne;
|
||||
use Hyperf\Database\Query\Builder;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $order_inquiry_id 主键id
|
||||
* @property int $user_id 用户id-患者
|
||||
* @property int $patient_id 患者id
|
||||
* @property int $doctor_id 医生id(未分配时为null)
|
||||
* @property int $family_id 家庭成员id(就诊用户)
|
||||
* @property string $order_inquiry_id 主键id
|
||||
* @property string $user_id 用户id-患者
|
||||
* @property string $patient_id 患者id
|
||||
* @property string $doctor_id 医生id(未分配时为null)
|
||||
* @property string $family_id 家庭成员id(就诊用户)
|
||||
* @property int $inquiry_type 订单类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
|
||||
* @property int $inquiry_mode 订单问诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
|
||||
* @property int $inquiry_status 问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消)
|
||||
* @property int $is_delete 删除状态(0:否 1:是)
|
||||
* @property int $inquiry_refund_status 问诊订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭)
|
||||
* @property string $inquiry_refund_no 系统退款单号
|
||||
* @property int $inquiry_pay_channel 支付渠道(1:小程序支付 2:微信扫码支付)
|
||||
* @property int $inquiry_pay_status 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
|
||||
* @property int $inquiry_no 订单编号
|
||||
* @property int $inquiry_no 系统订单编号
|
||||
* @property string $escrow_trade_no 第三方支付流水号
|
||||
* @property string $amount_total 订单金额
|
||||
* @property string $payment_amount_total 实际付款金额
|
||||
@@ -43,6 +45,7 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property int $patient_age 患者年龄-就诊人
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
* @property-read UserDoctor $UserDoctor
|
||||
*/
|
||||
class OrderInquiry extends Model
|
||||
{
|
||||
@@ -56,12 +59,7 @@ class OrderInquiry extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['order_inquiry_id', 'user_id', 'patient_id', 'doctor_id', 'family_id', 'inquiry_type', 'inquiry_mode', 'inquiry_status', 'is_delete', 'inquiry_refund_status', 'inquiry_pay_channel', 'inquiry_pay_status', 'inquiry_no', 'escrow_trade_no', 'amount_total', 'payment_amount_total', 'pay_time', 'reception_time', 'complete_time', 'finish_time', 'settlement_amount_total', 'settlement_status', 'settlement_time', 'cancel_time', 'cancel_reason', 'cancel_remarks', 'patient_name', 'patient_name_mask', 'patient_sex', 'patient_age', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['order_inquiry_id' => 'string', 'user_id' => 'string', 'patient_id' => 'string', 'doctor_id' => 'string', 'family_id' => 'string', 'inquiry_type' => 'integer', 'inquiry_mode' => 'integer', 'inquiry_status' => 'integer', 'is_delete' => 'integer', 'inquiry_refund_status' => 'integer', 'inquiry_pay_channel' => 'integer', 'inquiry_pay_status' => 'integer', 'inquiry_no' => 'integer', 'settlement_status' => 'integer', 'cancel_reason' => 'integer', 'patient_sex' => 'integer', 'patient_age' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
protected array $fillable = ['order_inquiry_id', 'user_id', 'patient_id', 'doctor_id', 'family_id', 'inquiry_type', 'inquiry_mode', 'inquiry_status', 'is_delete', 'inquiry_refund_status', 'inquiry_refund_no', 'inquiry_pay_channel', 'inquiry_pay_status', 'inquiry_no', 'escrow_trade_no', 'amount_total', 'payment_amount_total', 'pay_time', 'reception_time', 'complete_time', 'finish_time', 'settlement_amount_total', 'settlement_status', 'settlement_time', 'cancel_time', 'cancel_reason', 'cancel_remarks', 'patient_name', 'patient_name_mask', 'patient_sex', 'patient_age', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "order_inquiry_id";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user