public static function onActivateForGZH($openid) { $nk = Nosql::NK_ACTIVATE_FOR_GZH . $openid; $ret = Nosql::get($nk); if (!empty($ret)) { return; } Nosql::setex($nk, Nosql::NK_ACTIVATE_FOR_GZH_EXPIRE, 'x'); AsyncModel::asyncDBOpt('activate_for_gzh', array('openid' => $openid)); }
public static function timeLimitFunction($nk, $expire, $func, $params) { $ret = Nosql::get($nk); if (!empty($ret)) { return false; } if (call_user_func_array($func, $params)) { Nosql::setex($nk, $expire, 'x'); return true; } return false; }
public static function onCreateOrderOk($orderId, $orderAttach) { // 构造一个订单业务数据集,用来后续业务使用,针对一些不敏感的数据 $nk = Nosql::NK_ORDER_ATTACH_INFO . $orderId; Nosql::setex($nk, Nosql::NK_ORDER_ATTACH_INFO_EXPIRE, json_encode($orderAttach)); }