新增处方平台推送数据
This commit is contained in:
@@ -248,7 +248,7 @@ class OrderInquiry extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某种状态的所有订单
|
||||
* 获取某种状态、不包含某医生的所有订单
|
||||
* @param array $params
|
||||
* @param array $inquiry_status_params
|
||||
* @param array $not_in_params
|
||||
@@ -282,6 +282,20 @@ class OrderInquiry extends Model
|
||||
->first($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某种状态的订单
|
||||
* @param array $params
|
||||
* @param array $inquiry_status_params
|
||||
* @param array $fields
|
||||
* @return object|null
|
||||
*/
|
||||
public static function getInquiryStatusList(array $params, array $inquiry_status_params, array $fields = ["*"]): object|null
|
||||
{
|
||||
return self::where($params)
|
||||
->whereIn('inquiry_status', $inquiry_status_params)
|
||||
->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param array $params
|
||||
@@ -375,4 +389,22 @@ class OrderInquiry extends Model
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取某种状态的订单-限制条数
|
||||
* @param array $params
|
||||
* @param array $inquiry_status_params
|
||||
* @param array $fields
|
||||
* @param int $offset 起始
|
||||
* @param int $limit 个数
|
||||
* @return Collection|array
|
||||
*/
|
||||
public static function getInquiryStatusLimit(array $params, array $inquiry_status_params, array $fields = ["*"],int $offset = 0,int $limit = 10): Collection|array
|
||||
{
|
||||
return self::where($params)
|
||||
->whereIn('inquiry_status', $inquiry_status_params)
|
||||
->offset($offset)
|
||||
->limit($limit)
|
||||
->get($fields);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,4 +244,61 @@ class OrderPrescription extends Model
|
||||
])
|
||||
->where($params)->first($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某种状态的处方订单总数
|
||||
* @param array $params
|
||||
* @param array $prescription_status_params
|
||||
* @return int
|
||||
*/
|
||||
public static function getStatusCount(array $params, array $prescription_status_params): int
|
||||
{
|
||||
return self::where($params)->whereIn("prescription_status", $prescription_status_params)->count();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某种状态的处方订单-限制条数
|
||||
* @param array $params
|
||||
* @param array $prescription_status_params
|
||||
* @param array $fields
|
||||
* @param int $offset 起始
|
||||
* @param int $limit 个数
|
||||
* @return Collection|array
|
||||
*/
|
||||
public static function getStatusLimit(array $params, array $prescription_status_params, array $fields = ["*"],int $offset = 0,int $limit = 10): Collection|array
|
||||
{
|
||||
return self::where($params)
|
||||
->whereIn('prescription_status', $prescription_status_params)
|
||||
->offset($offset)
|
||||
->limit($limit)
|
||||
->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某种状态的处方订单
|
||||
* @param array $params
|
||||
* @param array $prescription_status_params
|
||||
* @param array $fields
|
||||
* @return object|null
|
||||
*/
|
||||
public static function getStatusList(array $params, array $prescription_status_params, array $fields = ["*"]): object|null
|
||||
{
|
||||
return self::where($params)
|
||||
->whereIn('prescription_status', $prescription_status_params)
|
||||
->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某种状态的处方订单-单条
|
||||
* @param array $params
|
||||
* @param array $prescription_status_params
|
||||
* @param array $fields
|
||||
* @return object|null
|
||||
*/
|
||||
public static function getStatusOne(array $params, array $prescription_status_params, array $fields = ["*"]): object|null
|
||||
{
|
||||
return self::where($params)
|
||||
->whereIn('prescription_status', $prescription_status_params)
|
||||
->first($fields);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $report_regulatory_id 主键id
|
||||
* @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_type 问诊上报类型(1:网络初诊 2:网络复诊)
|
||||
* @property string $report_inquiry_time 问诊上报时间
|
||||
* @property string $report_inquiry_fail_reason 问诊上报失败原因
|
||||
* @property int $report_prescription_status 处方上报状态(0:未上报 1:已上报 2:上报失败)
|
||||
* @property string $report_prescription_time 处方上报时间
|
||||
* @property string $report_prescription_fail_reason 处方上报失败原因
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
*/
|
||||
class ReportRegulatory extends Model
|
||||
{
|
||||
use Snowflake;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'report_regulatory';
|
||||
|
||||
/**
|
||||
* 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_type', 'report_inquiry_time', 'report_inquiry_fail_reason', 'report_prescription_status', 'report_prescription_time', 'report_prescription_fail_reason', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "report_regulatory_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 $data
|
||||
* @return ReportRegulatory|\Hyperf\Database\Model\Model
|
||||
*/
|
||||
public static function addReportRegulatory(array $data): ReportRegulatory|\Hyperf\Database\Model\Model
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user