新增药品订单接口
This commit is contained in:
@@ -32,6 +32,7 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property string $pay_time 支付时间
|
||||
* @property string $remarks 订单备注
|
||||
* @property int $refund_status 商品订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭)
|
||||
* @property string $cancel_time 订单取消时间
|
||||
* @property string $cancel_remarks 订单取消备注(自动添加)
|
||||
* @property int $province_id 省份id
|
||||
* @property string $province 省份
|
||||
@@ -47,6 +48,7 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property string $consignee_tel_mask 收货人电话(掩码)
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
* @property-read \Hyperf\Database\Model\Collection|OrderProductItem[] $OrderProductItem
|
||||
*/
|
||||
class OrderProduct extends Model
|
||||
{
|
||||
@@ -60,7 +62,7 @@ class OrderProduct extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['order_product_id', 'order_inquiry_id', 'order_prescription_id', 'doctor_id', 'patient_id', 'family_id', 'order_product_no', 'escrow_trade_no', 'order_product_status', 'pay_channel', 'pay_status', 'is_delete', 'cancel_reason', 'amount_total', 'payment_amount_total', 'logistics_fee', 'logistics_no', 'pay_time', 'remarks', 'refund_status', 'cancel_remarks', 'province_id', 'province', 'city_id', 'city', 'county_id', 'county', 'address', 'address_mask', 'consignee_name', 'consignee_name_mask', 'consignee_tel', 'consignee_tel_mask', 'created_at', 'updated_at'];
|
||||
protected array $fillable = ['order_product_id', 'order_inquiry_id', 'order_prescription_id', 'doctor_id', 'patient_id', 'family_id', 'order_product_no', 'escrow_trade_no', 'order_product_status', 'pay_channel', 'pay_status', 'is_delete', 'cancel_reason', 'amount_total', 'payment_amount_total', 'logistics_fee', 'logistics_no', 'pay_time', 'remarks', 'refund_status', 'cancel_time', 'cancel_remarks', 'province_id', 'province', 'city_id', 'city', 'county_id', 'county', 'address', 'address_mask', 'consignee_name', 'consignee_name_mask', 'consignee_tel', 'consignee_tel_mask', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "order_product_id";
|
||||
|
||||
@@ -139,4 +141,15 @@ class OrderProduct extends Model
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param array $params
|
||||
* @param array $data
|
||||
* @return int
|
||||
*/
|
||||
public static function edit(array $params = [], array $data = []): int
|
||||
{
|
||||
return self::where($params)->update($data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,4 +282,20 @@ class UserDoctor extends Model
|
||||
{
|
||||
return self::where($params)->exists();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生数据
|
||||
* 关联医院表
|
||||
* @param array $params
|
||||
* @param array $fields
|
||||
* @return object|null
|
||||
*/
|
||||
public static function getWithHospitalOne(array $params,array $fields = ['*']): object|null
|
||||
{
|
||||
return self::with([
|
||||
"Hospital:hospital_id,hospital_name,hospital_level_name"
|
||||
])
|
||||
->where($params)
|
||||
->first($fields);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user