<?php
/** 
 * UQ云商：	www.uqcms.com  
 * 联系QQ：	2200631718 
 * 可免费商用，需要留UQ云商链接作为交换，只首页底部留取即可，不影响使用。
 */

defined('IN_UQ') or exit('Access Denied'); class address_mod extends module { function __construct() { $this->uid = @$_SESSION['user']['uid']; parent::__construct(); } public function get_one($uq0) { $uq1 = $uq0['id']??false; if(!empty($this->uid)){ if($uq1){ $uq2 = $this->db->get_one("select * from ".table('member_address')." where uid = ".$this->uid." and id = ".$uq1); if($uq2['id']){ if($uq2['prov']){ $uq3 = $uq2['prov_cn']; }else{ $uq3 = ''; } if($uq2['city']){ $uq4 = '/'.$uq2['city_cn']; }else{ $uq4 = ''; } if($uq2['dist']){ $uq5 = '/'.$uq2['dist_cn']; }else{ $uq5 = ''; } $uq2['area'] = $uq3.$uq4.$uq5; return $uq2; }else{ return false; } }else{ return false; } }else{ return false; } } public function get_all() { if(!empty($this->uid)){ $uq6 = $this->db->get_all("select * from ".table('member_address')." where uid = ".$this->uid." order by is_default desc, addtime desc"); if($uq6){ foreach($uq6 as $uq7){ if($uq7['prov']){ $uq3 = $uq7['prov_cn']; }else{ $uq3 == ''; } if($uq7['city']){ $uq4 = ', '.$uq7['city_cn']; }else{ $uq4 == ''; } if($uq7['dist']){ $uq5 = ', '.$uq7['dist_cn']; }else{ $uq5 == ''; } $uq7['area'] = $uq3.$uq4.$uq5; $uq8[] = $uq7; } return $uq8; }else{ return false; } }else{ return false; } } public function get_session_address() { $uq9 = $_SESSION['settle_address_id']??false; if($uq9){ $uq8 = $this->db->get_one("select * from ".table('member_address')." where uid = ".$this->uid." and id = ".$uq9); if($uq8['id']){ return $uq8; }else{ return false; } }else{ return false; } } function get_cn($uq10) { $uq10 = array_filter($uq10); $uq11 = implode(',', $uq10); if($uq11){ $uq12 = $this->db->get_all("select * from ".table('area')." where id in(".$uq11.") order by level desc"); if($uq12){ foreach($uq12 as $uq13=>$uq7){ $uq8[$uq7['id']] = $uq7; } return $uq8; }else{ return false; } }else{ return false; } } } 