|
|
|
@ -24,17 +24,7 @@ class Order extends BaseModel |
|
|
|
|
|
|
|
public function getStatusTextAttribute() |
|
|
|
{ |
|
|
|
$status_text = [ |
|
|
|
Status::CANCEL => '已取消', |
|
|
|
Status::UNPAID => '待付款', |
|
|
|
Status::PAY_EARNEST => '已付定金', |
|
|
|
Status::PAID => '已付款', |
|
|
|
Status::PAID_RETAINAGE => '已付尾款', |
|
|
|
Status::REFUNDING => '退款中', |
|
|
|
Status::REFUNDED => '已退款', |
|
|
|
Status::SUCCESS => '已完成', |
|
|
|
]; |
|
|
|
return $status_text[$this->status] ?? '未知'; |
|
|
|
return Status::array()[$this->status] ?? '未知'; |
|
|
|
} |
|
|
|
|
|
|
|
//退款信息
|
|
|
|
@ -49,6 +39,11 @@ class Order extends BaseModel |
|
|
|
return $value ?? []; |
|
|
|
} |
|
|
|
|
|
|
|
public function getPictureAttribute($value) |
|
|
|
{ |
|
|
|
return $value ? $this->host . $value : ''; |
|
|
|
} |
|
|
|
|
|
|
|
public function agentProduct() |
|
|
|
{ |
|
|
|
return $this->belongsTo(AgentProduct::class); |
|
|
|
@ -63,4 +58,14 @@ class Order extends BaseModel |
|
|
|
{ |
|
|
|
return $this->belongsTo(Coupon::class); |
|
|
|
} |
|
|
|
|
|
|
|
public function agent() |
|
|
|
{ |
|
|
|
return $this->belongsTo(Agent::class); |
|
|
|
} |
|
|
|
|
|
|
|
public function supplier() |
|
|
|
{ |
|
|
|
return $this->belongsTo(Supplier::class); |
|
|
|
} |
|
|
|
} |