<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Util; use Carbon\Carbon; use ModStart\Core\Dao\ModelUtil; class MemberMetaUtil { public static function set($d4RRw, $MGY9H, $hsART = null) { $HBsr7 = array('memberUserId' => $d4RRw, 'name' => $MGY9H); if (is_null($hsART)) { ModelUtil::delete('member_meta', $HBsr7); } else { if (ModelUtil::update('member_meta', $HBsr7, array('value' => $hsART, 'updated_at' => Carbon::now())) <= 0) { goto P2D4B; P2D4B: ModelUtil::transactionBegin(); goto V66SJ; V66SJ: $dRTD0 = ModelUtil::getWithLock('member_meta', $HBsr7); goto h69oL; OFc2B: ModelUtil::transactionCommit(); goto Ibnj6; h69oL: if (empty($dRTD0)) { ModelUtil::insert('member_meta', array_merge($HBsr7, array('value' => $hsART))); } goto OFc2B; Ibnj6: } } } public static function get($d4RRw, $MGY9H) { goto UvuIB; pbm2B: $sZ6HZ = ModelUtil::get('member_meta', $HBsr7); goto YfmEU; YfmEU: if ($sZ6HZ) { return $sZ6HZ['value']; } goto s92ry; s92ry: return null; goto tY1ti; UvuIB: $HBsr7 = array('memberUserId' => $d4RRw, 'name' => $MGY9H); goto pbm2B; tY1ti: } }