Files
hospital-applets-api/app/Model/OrderProduct.php
T
2023-03-01 13:52:06 +08:00

94 lines
3.6 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Model;
use Hyperf\Database\Model\Collection;
use Hyperf\Snowflake\Concern\Snowflake;
/**
* @property int $order_product_id 主键id
* @property int $order_inquiry_id 订单-问诊id
* @property int $order_prescription_id 订单-处方id
* @property int $doctor_id 医生id
* @property string $order_product_no 订单编号
* @property string $escrow_trade_no 第三方支付流水号
* @property int $order_product_status 订单状态(1:待支付 2:待发货 3:已发货 4:已签收 5:已完成 6:已取消)
* @property int $pay_channel 支付渠道(1:小程序支付 2:微信扫码支付)
* @property int $pay_status 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
* @property int $cancel_reason 订单取消原因(1:主动取消 2:复核失败/库存不足 3:支付超时)
* @property string $amount_total 订单金额
* @property string $payment_amount_total 实际付款金额
* @property string $logistics_fee 运费金额
* @property string $logistics_no 物流编号
* @property string $pay_time 支付时间
* @property string $remarks 订单备注
* @property int $refund_status 商品订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭)
* @property string $cancel_remarks 订单取消备注(自动添加)
* @property int $province_id 省份id
* @property string $province 省份
* @property int $city_id 城市id
* @property string $city 城市
* @property int $county_id 区县id
* @property string $county 区县
* @property string $address 详细地址
* @property string $address_mask 详细地址(掩码)
* @property string $consignee_name 收货人姓名
* @property string $consignee_name_mask 收货人姓名(掩码)
* @property string $consignee_tel 收货人电话
* @property string $consignee_tel_mask 收货人电话(掩码)
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间
*/
class OrderProduct extends Model
{
use Snowflake;
/**
* The table associated with the model.
*/
protected ?string $table = 'order_product';
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['order_product_id', 'order_inquiry_id', 'order_prescription_id', 'doctor_id', 'order_product_no', 'escrow_trade_no', 'order_product_status', 'pay_channel', 'pay_status', '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 string $primaryKey = "order_product_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();
}
}