<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Util; use ModStart\Core\Dao\ModelUtil; class MemberAddressUtil { public static function getUserAddress($nlOSA, $StE5h) { goto JUEeB; JUEeB: $rpy90 = ModelUtil::get('member_address', array('id' => $StE5h, 'memberUserId' => $nlOSA)); goto CwC1b; QQDxZ: return $rpy90; goto CBtce; CwC1b: ModelUtil::decodeRecordBoolean($rpy90, array('isDefault')); goto QQDxZ; CBtce: } public static function listUserAddresses($nlOSA) { goto RwbKD; Bc0Qw: ModelUtil::decodeRecordsBoolean($Y9WQp, array('isDefault')); goto q7_4a; q7_4a: return $Y9WQp; goto SALf8; RwbKD: $Y9WQp = ModelUtil::model('member_address')->where(array('memberUserId' => $nlOSA))->orderBy('id', 'desc')->orderBy('isDefault', 'desc')->get()->toArray(); goto Bc0Qw; SALf8: } public static function delete($StE5h) { ModelUtil::delete('member_address', array('id' => $StE5h)); } public static function resetDefault($nlOSA) { ModelUtil::update('member_address', array('memberUserId' => $nlOSA), array('isDefault' => false)); } public static function update($StE5h, $cwaKT) { return ModelUtil::update('member_address', array('id' => $StE5h), $cwaKT); } public static function insert($cwaKT) { return ModelUtil::insert('member_address', $cwaKT); } public static function getDefault($nlOSA) { goto EXFuO; EXFuO: $fk1iR = ModelUtil::get('member_address', array('memberUserId' => $nlOSA, 'isDefault' => true)); goto x1eXH; x1eXH: if (empty($fk1iR)) { $fk1iR = ModelUtil::get('member_address', array('memberUserId' => $nlOSA)); } goto iKy9N; iKy9N: return $fk1iR; goto jdYDS; jdYDS: } public static function clearDefault($nlOSA) { ModelUtil::update('member_address', array('memberUserId' => $nlOSA), array('isDefault' => false)); } public static function truncate($nlOSA) { ModelUtil::delete('member_address', array('memberUserId' => $nlOSA)); } }