初始化项目:添加后端代码、ThinkPHP框架、前端资源
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user