|
|
|
@ -12,6 +12,7 @@ declare (strict_types=1); |
|
|
|
|
|
|
|
|
|
namespace app\common\model; |
|
|
|
|
|
|
|
|
|
use app\common\enum\order\refund\RefundType; |
|
|
|
|
use cores\BaseModel; |
|
|
|
|
use think\model\relation\BelongsTo; |
|
|
|
|
use think\model\relation\HasMany; |
|
|
|
@ -30,6 +31,13 @@ class OrderRefund extends BaseModel |
|
|
|
|
// 定义主键 |
|
|
|
|
protected $pk = 'order_refund_id'; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 追加字段 |
|
|
|
|
*/ |
|
|
|
|
protected $append = [ |
|
|
|
|
'refund_type_text' |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 关联用户表 |
|
|
|
|
* @return BelongsTo |
|
|
|
@ -113,4 +121,9 @@ class OrderRefund extends BaseModel |
|
|
|
|
{ |
|
|
|
|
return static::get($where, $with); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getRefundTypeTextAttr($value, $data): string |
|
|
|
|
{ |
|
|
|
|
return !empty(RefundType::data()[$data['type']]) ? RefundType::data()[$data['type']]['name'] : ''; |
|
|
|
|
} |
|
|
|
|
} |