<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Util; use Carbon\Carbon; use ModStart\Core\Dao\ModelUtil; class MemberMetaUtil { public static function set($KJqKC, $L1N0l, $fo71I = null) { $xAO9M = array('memberUserId' => $KJqKC, 'name' => $L1N0l); if (is_null($fo71I)) { ModelUtil::delete('member_meta', $xAO9M); } else { if (ModelUtil::update('member_meta', $xAO9M, array('value' => $fo71I, 'updated_at' => Carbon::now())) <= 0) { goto xb0pZ; eBkWa: $M0WVk = ModelUtil::getWithLock('member_meta', $xAO9M); goto dxpn6; xb0pZ: ModelUtil::transactionBegin(); goto eBkWa; dxpn6: if (empty($M0WVk)) { ModelUtil::insert('member_meta', array_merge($xAO9M, array('value' => $fo71I))); } goto ygGhL; ygGhL: ModelUtil::transactionCommit(); goto lT2_c; lT2_c: } } } public static function get($KJqKC, $L1N0l) { goto Q1IwX; FNlvh: if ($jo__y) { return $jo__y['value']; } goto TQlXO; TQlXO: return null; goto EynQ9; Q1IwX: $xAO9M = array('memberUserId' => $KJqKC, 'name' => $L1N0l); goto dt5O4; dt5O4: $jo__y = ModelUtil::get('member_meta', $xAO9M); goto FNlvh; EynQ9: } }