'array']; protected static function booted() { parent::booted(); static::creating(function ($order) { if (strtoupper((string)$order->coin) === 'USDT' && !array_key_exists('recharge_bonus_snapshot', $order->getAttributes())) { $snapshot = \App\Services\RechargeBonusService::capture('usdt', (string)$order->member_id); if ($snapshot !== null) $order->recharge_bonus_snapshot = $snapshot; } }); } const STATUS_STAY = 0; const STATUS_SUCCESS = 1; const STATUS_FAIL = 2; const STATUS_IGNORE = 3; public static $STATUS = [ 0 => '待确认', 1 => '已确认', 2 => '失败', 3 => '已忽略', ]; const TYPE_AUTO = 1; // 自动 const TYPE_HAND = 2; // 手动 public function member() { return $this->belongsTo(User::class, 'member_id', 'member_id') ->select(['id', 'member_id', 'username', 'first_name', 'admin_note', 'status', 'phone', 'visitor_id', 'register_ip']); } protected function getAmountAttribute($value) { return floatval($value); } protected function getImageAttribute($value) { return Util::ensureUrl($value); } protected function setImageAttribute($value) { $this->attributes['image'] = Util::replacePartInUrl($value); } }