73 lines
1.9 KiB
PHP
Executable File
73 lines
1.9 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* @createtime 2023/4/20
|
|
* @author wild
|
|
* @copyright PhpStorm
|
|
*/
|
|
|
|
|
|
namespace App\Model\Seller;
|
|
|
|
use App\Model\BaseModel;
|
|
use App\Utils\Helps;
|
|
|
|
class ShopExtra extends BaseModel
|
|
{
|
|
protected $appends = [
|
|
'individual_url',
|
|
'business_door_url',
|
|
'sale_proxy_url',
|
|
'sale_proxy_hand_url',
|
|
'identity_pros_url',
|
|
'identity_cons_url',
|
|
'identity_hand_url',
|
|
];
|
|
|
|
public function shop() {
|
|
return $this->belongsTo(Shop::class, 'shop_id', 'id');
|
|
}
|
|
|
|
public function getIndividualUrlAttribute() {
|
|
if (!$this->individual) {
|
|
return $this->individual;
|
|
}
|
|
return Helps::fullUrl($this->individual);
|
|
}
|
|
public function getBusinessDoorUrlAttribute() {
|
|
if (!$this->business_door) {
|
|
return $this->business_door;
|
|
}
|
|
return Helps::fullUrl($this->business_door);
|
|
}
|
|
public function getSaleProxyUrlAttribute() {
|
|
if (!$this->sale_proxy) {
|
|
return $this->sale_proxy;
|
|
}
|
|
return Helps::fullUrl($this->sale_proxy);
|
|
}
|
|
public function getSaleProxyHandUrlAttribute() {
|
|
if (!$this->sale_proxy_hand) {
|
|
return $this->sale_proxy_hand;
|
|
}
|
|
return Helps::fullUrl($this->sale_proxy_hand);
|
|
}
|
|
public function getIdentityProsUrlAttribute() {
|
|
if (!$this->identity_pros) {
|
|
return $this->identity_pros;
|
|
}
|
|
return Helps::fullUrl($this->identity_pros);
|
|
}
|
|
public function getIdentityConsUrlAttribute() {
|
|
if (!$this->identity_cons) {
|
|
return $this->identity_cons;
|
|
}
|
|
return Helps::fullUrl($this->identity_cons);
|
|
}
|
|
public function getIdentityHandUrlAttribute() {
|
|
if (!$this->identity_hand) {
|
|
return $this->identity_hand;
|
|
}
|
|
return Helps::fullUrl($this->identity_hand);
|
|
}
|
|
}
|