wechat_qrcode) { return ''; } return Helps::fullUrl($this->wechat_qrcode); } public function getAlipayQrcodeUrlAttribute() { if (!$this->alipay_qrcode) { return ''; } return Helps::fullUrl($this->alipay_qrcode); } public function getBusinessSiteUrlAttribute() { if (!$this->business_site) { return ''; } return Helps::fullUrl($this->business_site); } public function getBusinessDoorUrlAttribute() { if (!$this->business_door) { return ''; } return Helps::fullUrl($this->business_door); } public function getSaleProxyUrlAttribute() { if (!$this->sale_proxy) { return ''; } return Helps::fullUrl($this->sale_proxy); } public function getPayChannelNameAttribute() { if ($this->pay_type == PayType::ALIPAY) { $channels = self::payChannels(); return $this->channel_name . '(' . Arr::get($channels, $this->pay_channel) . ')'; } return $this->channel_name; } public static function payChannels() { return [ 1 => '渠道一', 2 => '渠道二', 3 => '渠道三', ]; } public function shop() { return $this->belongsTo(Shop::class, 'shop_id', 'id'); } public static function stateAsArray() { return [ self::STATE_SUCCESS => '成功', self::STATE_FAIL => '失败', self::STATE_SUBMIT => '提交', ]; } }