新增处方平台推送数据
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user