| 
					
				 | 
			
			
				@@ -36,31 +36,16 @@ class Api 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $base->combine(3, 321313); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    # 获取地址列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function getAddress($uid) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    # 更新用户表的地址 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public function upAddress($uid, $address_contact, $address_mobile, $area_id = '', $address = '') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $where['uid'] = $uid; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $data = Dever::db('passport/address')->getList($where); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return $data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    # 添加或者更新地址 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public function upAddress($id, $uid, $country, $province, $city, $area, $address) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $update['country'] = $country; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $update['province'] = $province; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $update['city'] = $city; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $update['area'] = $area; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $update['area'] = $address; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if ($id) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $update['where_id'] = $id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Dever::db('passport/address')->update($update); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $update['uid'] = $uid; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $id = Dever::db('passport/address')->insert($update); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        return $id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $update['where_id'] = $uid; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $update['address_contact'] = $address_contact; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $update['address_mobile'] = $address_mobile; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $update['area_id'] = $area_id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $update['address'] = $address; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Dever::db('passport/user')->update($update); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return 'ok'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 |