删除自动开方时增加上报处方数据。增加自动结束时上报处方数据,修改上报处方脚本
This commit is contained in:
@@ -15,11 +15,16 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property int $order_inquiry_id 订单-问诊id
|
||||
* @property int $order_prescription_id 订单-处方表id(无需上报处方时为null)
|
||||
* @property int $order_product_id 订单-商品表id(无需上报处方时为null)
|
||||
* @property int $report_inquiry_status 问诊上报状态(0:未上报 1:已上报 2:上报失败)
|
||||
* @property int $report_inquiry_int 问诊上报次数
|
||||
* @property int $report_inquiry_type 问诊上报类型(1:网络初诊 2:网络复诊)
|
||||
* @property string $report_inquiry_time 问诊上报时间
|
||||
* @property string $report_inquiry_fail_reason 问诊上报失败原因
|
||||
* @property int $report_consult_status 上报网络咨询状态(0:未上报 1:已上报 2:上报失败)
|
||||
* @property int $report_consult_int 网络咨询上报次数
|
||||
* @property string $report_consult_time 网络咨询上报时间
|
||||
* @property string $report_consult_fail_reason 网络咨询上报失败原因
|
||||
* @property int $is_further_consult 是否需要上报网络复诊(0:否 1:是)
|
||||
* @property int $report_further_consult_status 上报网络复诊状态(0:未上报 1:已上报 2:上报失败)
|
||||
* @property int $report_further_consult_int 网络复诊上报次数
|
||||
* @property string $report_further_consult_time 网络复诊上报时间
|
||||
* @property string $report_further_consult_fail_reason 网络复诊上报失败原因
|
||||
* @property int $is_prescription 是否需要上报处方(0:否 1:是)
|
||||
* @property int $report_prescription_status 处方上报状态(0:未上报 1:已上报 2:上报失败)
|
||||
* @property int $report_prescription_int 处方上报次数
|
||||
* @property string $report_prescription_time 处方上报时间
|
||||
@@ -39,11 +44,10 @@ class ReportRegulatory extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['report_regulatory_id', 'order_inquiry_id', 'order_prescription_id', 'order_product_id', 'report_inquiry_status', 'report_inquiry_int', 'report_inquiry_type', 'report_inquiry_time', 'report_inquiry_fail_reason', 'report_prescription_status', 'report_prescription_int', 'report_prescription_time', 'report_prescription_fail_reason', 'created_at', 'updated_at'];
|
||||
protected array $fillable = ['report_regulatory_id', 'order_inquiry_id', 'order_prescription_id', 'order_product_id', 'report_consult_status', 'report_consult_int', 'report_consult_time', 'report_consult_fail_reason', 'is_further_consult', 'report_further_consult_status', 'report_further_consult_int', 'report_further_consult_time', 'report_further_consult_fail_reason', 'is_prescription', 'report_prescription_status', 'report_prescription_int', 'report_prescription_time', 'report_prescription_fail_reason', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "report_regulatory_id";
|
||||
|
||||
|
||||
/**
|
||||
* 获取信息-单条
|
||||
* @param array $params
|
||||
@@ -116,23 +120,6 @@ class ReportRegulatory extends Model
|
||||
->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
* @param array $params
|
||||
* @param array $or_params
|
||||
* @param array $fields
|
||||
* @return Collection|array
|
||||
*/
|
||||
public static function getNotReportList(array $params = [],array $fields = ["*"]): Collection|array
|
||||
{
|
||||
return self::where($params)
|
||||
->Where(function ($query) {
|
||||
$query->orWhere('report_inquiry_status','!=',1);
|
||||
$query->orWhere('report_prescription_status','!=',1);
|
||||
})
|
||||
->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测是否存在
|
||||
* @param array $params
|
||||
@@ -142,4 +129,29 @@ class ReportRegulatory extends Model
|
||||
{
|
||||
return self::where($params)->exists();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取未上报监管平台列表
|
||||
* @param array $fields
|
||||
* @return Collection|array
|
||||
*/
|
||||
public static function getNotReportList(array $fields = ["*"]): Collection|array
|
||||
{
|
||||
return self::orWhere(function ($query) {
|
||||
$query->Where('is_further_consult','=',1);
|
||||
$query->Where('report_further_consult_status','!=',1);
|
||||
$query->Where('report_further_consult_int','<',5);
|
||||
})
|
||||
->orWhere(function ($query) {
|
||||
$query->Where('is_prescription','=',1);
|
||||
$query->Where('report_prescription_status','!=',1);
|
||||
$query->Where('report_prescription_int','<',5);
|
||||
})
|
||||
->orWhere(function ($query) {
|
||||
$query->Where('report_consult_status','!=',1);
|
||||
$query->Where('report_consult_int','<',5);
|
||||
})
|
||||
->get($fields);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user