You've already forked guangan
订单下单相关
This commit is contained in:
@ -31,15 +31,6 @@ class PointsMallGoods extends Model
|
||||
->where(['status' => 1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联商品评论数据
|
||||
* @return \think\model\relation\HasMany
|
||||
*/
|
||||
public function comments()
|
||||
{
|
||||
return $this->hasMany(PluginWemallUserActionComment::class, 'gcode', 'code')->with('bindUser');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联产品列表
|
||||
* @return array
|
||||
|
@ -44,54 +44,58 @@ class PointsMallOrder extends Model
|
||||
// {
|
||||
// return $this->hasMany(PluginPaymentRecord::class, 'order_no', 'order_no')->order('id desc')->withoutField('payment_notify');
|
||||
// }
|
||||
|
||||
/**
|
||||
* 关联收货地址
|
||||
* @return \think\model\relation\HasOne
|
||||
*/
|
||||
public function address()
|
||||
{
|
||||
return $this->hasOne(PointsMallAddress::class, 'id', 'address_id');
|
||||
}
|
||||
public function sender()
|
||||
{
|
||||
return $this->hasOne(PointsMallOrderSender::class, 'order_no', 'order_no');
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * 关联收货地址
|
||||
// * @return \think\model\relation\HasOne
|
||||
// * 格式化支付通道
|
||||
// * @param mixed $value
|
||||
// * @return array
|
||||
// */
|
||||
// public function address()
|
||||
// public function getPaymentAllowsAttr($value): array
|
||||
// {
|
||||
// return $this->hasOne(PluginWemallOrderSender::class, 'order_no', 'order_no');
|
||||
// $payments = is_string($value) ? str2arr($value) : [];
|
||||
// return in_array('all', $payments) ? ['all'] : $payments;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 时间格式处理
|
||||
// * @param mixed $value
|
||||
// * @return string
|
||||
// */
|
||||
// public function getPaymentTimeAttr($value): string
|
||||
// {
|
||||
// return $this->getCreateTimeAttr($value);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 时间格式处理
|
||||
// * @param mixed $value
|
||||
// * @return string
|
||||
// */
|
||||
// public function setPaymentTimeAttr($value): string
|
||||
// {
|
||||
// return $this->setCreateTimeAttr($value);
|
||||
// }
|
||||
//
|
||||
// public function setConfirmTimeAttr($value): string
|
||||
// {
|
||||
// return $this->setCreateTimeAttr($value);
|
||||
// }
|
||||
//
|
||||
// public function getConfirmTimeAttr($value): string
|
||||
// {
|
||||
// return $this->getCreateTimeAttr($value);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 格式化支付通道
|
||||
* @param mixed $value
|
||||
* @return array
|
||||
*/
|
||||
public function getPaymentAllowsAttr($value): array
|
||||
{
|
||||
$payments = is_string($value) ? str2arr($value) : [];
|
||||
return in_array('all', $payments) ? ['all'] : $payments;
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间格式处理
|
||||
* @param mixed $value
|
||||
* @return string
|
||||
*/
|
||||
public function getPaymentTimeAttr($value): string
|
||||
{
|
||||
return $this->getCreateTimeAttr($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间格式处理
|
||||
* @param mixed $value
|
||||
* @return string
|
||||
*/
|
||||
public function setPaymentTimeAttr($value): string
|
||||
{
|
||||
return $this->setCreateTimeAttr($value);
|
||||
}
|
||||
|
||||
public function setConfirmTimeAttr($value): string
|
||||
{
|
||||
return $this->setCreateTimeAttr($value);
|
||||
}
|
||||
|
||||
public function getConfirmTimeAttr($value): string
|
||||
{
|
||||
return $this->getCreateTimeAttr($value);
|
||||
}
|
||||
}
|
@ -16,23 +16,11 @@ class PointsMallOrderSender extends Model
|
||||
return $this->hasOne(PointsMallOrder::class, 'order_no', 'order_no')->with(['items']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置发货时间
|
||||
* @param mixed $value
|
||||
* @return string
|
||||
*/
|
||||
public function setExpressTimeAttr($value): string
|
||||
{
|
||||
return $this->setCreateTimeAttr($value);
|
||||
public function setExtraAttr($value) {
|
||||
return json_encode($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取发货时间
|
||||
* @param mixed $value
|
||||
* @return string
|
||||
*/
|
||||
public function getExpressTimeAttr($value): string
|
||||
{
|
||||
return $this->getCreateTimeAttr($value);
|
||||
public function getExtraAttr($value) {
|
||||
return json_decode($value, true);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user