$parent_id]); } /** * 获取收货地址列表 * @param [int] $where */ static public function getAddrList($where) { $list = ShopAddress::getList($where); return ShopAddressResource::collection($list); } static public function getOneAddr($addressId,$uid = 0){ if(empty($addressId) && $uid){ $info = ShopAddress::getDefault($uid); }else{ $info = ShopAddress::getOne(['id' =>$addressId]); } if(empty($info)){ return ['id'=>-1]; } return new ShopAddressResource($info); } static public function getRegionNameById($addressId){ $where['id'] = $addressId; $region = ShopRegion::getOne($where); return $region['name']; } }