1
0

提交代码

This commit is contained in:
2020-08-06 14:45:56 +08:00
commit 9d0d5f4be9
361 changed files with 36445 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
<?php
namespace App\Models;
use RuLong\Order\Contracts\Addressbook;
class UserAddress extends Model implements Addressbook
{
/**
* 收件人姓名
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* 收件人电话
* @return string
*/
public function getMobile()
{
return $this->mobile;
}
/**
* 收件人详细地址
* @return string
*/
public function getAddress()
{
if ($this->Area && $this->Area->info) {
return str_replace(",", "-", $this->Area->info) . '-' . $this->address;
}
return '';
}
/**
* 收件人详细地址
* @return string
*/
public function getAllAddressAttribute()
{
return str_replace(",", "-", $this->Area->info) . '-' . $this->address;
}
public function Area()
{
return $this->belongsTo(Area::class, 'area_sn', 'sn');
}
public function Province()
{
return $this->belongsTo(Area::class, 'province_sn', 'sn');
}
}