'待处理', 1 => '处理中', 2 => '已到账', 3 => '失败', 4 => '待提交凭证', 5 => '待审核', 6 => '已撤回', 7 => '超时', ]; protected $table = 'agent_payment_orders'; protected $guarded = ['id']; protected $fillable = []; protected $hidden = ['callback_data', 'callback_url']; protected $appends = ['status_text', 'type_text']; protected $casts = [ 'agent_id' => 'integer', 'type' => 'integer', 'status' => 'integer', 'payment_type' => 'integer', 'amount' => 'decimal:2', 'fee' => 'decimal:4', 'is_send' => 'integer', 'audit_admin_id' => 'integer', ]; public function agent() { return $this->belongsTo(Agent::class); } public function getStatusTextAttribute(): string { return self::STATUS_TEXT[(int) $this->status] ?? ''; } public function getTypeTextAttribute(): string { return (int) $this->type === 3 ? '人工充值' : '在线充值'; } public function getImageAttribute($value) { return $value ? Util::ensureUrl($value) : ''; } public function setImageAttribute($value) { $this->attributes['image'] = (string) Util::replacePartInUrl($value); } }