<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Util; use ModStart\Core\Dao\ModelUtil; class MemberAddressUtil { public static function getUserAddress($d4RRw, $M3rBS) { goto TC46P; KpfcY: ModelUtil::decodeRecordBoolean($HKoLA, array('isDefault')); goto VVMkL; VVMkL: return $HKoLA; goto fBNDR; TC46P: $HKoLA = ModelUtil::get('member_address', array('id' => $M3rBS, 'memberUserId' => $d4RRw)); goto KpfcY; fBNDR: } public static function listUserAddresses($d4RRw) { goto D8rPA; UUuIO: return $XsrNI; goto b0lro; D8rPA: $XsrNI = ModelUtil::model('member_address')->where(array('memberUserId' => $d4RRw))->orderBy('id', 'desc')->orderBy('isDefault', 'desc')->get()->toArray(); goto DAW0v; DAW0v: ModelUtil::decodeRecordsBoolean($XsrNI, array('isDefault')); goto UUuIO; b0lro: } public static function delete($M3rBS) { ModelUtil::delete('member_address', array('id' => $M3rBS)); } public static function resetDefault($d4RRw) { ModelUtil::update('member_address', array('memberUserId' => $d4RRw), array('isDefault' => false)); } public static function update($M3rBS, $Pg57y) { return ModelUtil::update('member_address', array('id' => $M3rBS), $Pg57y); } public static function insert($Pg57y) { return ModelUtil::insert('member_address', $Pg57y); } public static function getDefault($d4RRw) { goto i8VI2; i8VI2: $UiYds = ModelUtil::get('member_address', array('memberUserId' => $d4RRw, 'isDefault' => true)); goto piib7; w0pxU: return $UiYds; goto r0V91; piib7: if (empty($UiYds)) { $UiYds = ModelUtil::get('member_address', array('memberUserId' => $d4RRw)); } goto w0pxU; r0V91: } public static function clearDefault($d4RRw) { ModelUtil::update('member_address', array('memberUserId' => $d4RRw), array('isDefault' => false)); } public static function truncate($d4RRw) { ModelUtil::delete('member_address', array('memberUserId' => $d4RRw)); } }