41 lines
889 B
PHP
41 lines
889 B
PHP
<?php
|
|
|
|
namespace app\common\model\app\physical;
|
|
|
|
use think\Model;
|
|
|
|
/**
|
|
* 实物商品订单地址模型
|
|
*/
|
|
class OrderAddress extends Model
|
|
{
|
|
protected $name = 'app_physical_order_address';
|
|
|
|
protected $autoWriteTimestamp = 'integer';
|
|
protected $createTime = 'createtime';
|
|
protected $updateTime = 'updatetime';
|
|
protected $deleteTime = false;
|
|
|
|
/**
|
|
* 根据订单ID获取地址
|
|
* @param int $orderId 订单ID
|
|
* @return array|null
|
|
*/
|
|
public static function getByOrderId($orderId)
|
|
{
|
|
$address = self::where([
|
|
'order_id' => $orderId,
|
|
'uniacid' => UNIACID
|
|
])->field([
|
|
'mobile',
|
|
'city_name',
|
|
'province_name',
|
|
'district_name',
|
|
'address',
|
|
'consignee'
|
|
])->find();
|
|
|
|
return $address ? $address->toArray() : null;
|
|
}
|
|
}
|