public function updateOrder($orderId, $status) { $ret = true; //1未付款,2未发货,3已发货,4已关闭,5已删除 $condition = array('order_sn:eq' => $orderId); $order = TZ_Loader::model('Orders', 'Order')->select($condition, array('goods_id', 'status', 'num'), 'ROW'); if ($order['status'] == '1') { $cols = array('status' => $status); $ret = TZ_Loader::model('Orders', 'Order')->update($cols, $condition); TZ_Loader::model('Goods', 'Api')->updateNum($order['goods_id'], $order['num']); //刷新商品信息 $redis = TZ_Redis::connect('mall'); $redis->hDel('goods_info', $order['goods_id']); } return $ret; }
private static function _xhprofDisable() { if (!empty($_GET['debug'])) { if (!extension_loaded('xhprof')) { return false; } $xhprof_data = xhprof_disable(); $XHPROF_ROOT = APP_PATH . '/library/Xhprof'; include_once $XHPROF_ROOT . "/utils/xhprof_lib.php"; include_once $XHPROF_ROOT . "/utils/xhprof_runs.php"; $xhprof_runs = new XHProfRuns_Default(); $source = $_GET['debug']; $run_id = $xhprof_runs->save_run($xhprof_data, $source); $url = "/xhprof/xhprof_html/index.php?run={$run_id}&source={$source}"; TZ_Redis::connect('user')->setex("debug:xhprof:{$source}", 3600, $url); } }
/** * unset session info * * @param string $sessionId * @return void */ public function discard($sessionId) { $redis = TZ_Redis::connect('session'); return $redis->del(self::$_sessionPreKey . $sessionId); }
public function __construct() { $this->redis = TZ_Redis::connect('mall'); }
/** * In blacklist * * @param string $telephone * @return bool */ public function inList($telephone) { //return $this->_redis->sIsMember($this->_key, $telephone); return TZ_Redis::connect('black')->get($this->_black . $telephone); }
/** * 获取缓存系统的驱动对象 * * @return object */ private function _getCacheDriver() { if (null !== self::$_cacheDriver) { return self::$_cacheDriver; } return self::$_cacheDriver = TZ_Redis::connect('user'); }
/** * close connection * * @return void */ public static function close() { self::$_redis->close(); self::$_redis = null; }
public function __construct() { $this->_CCIDSource = TZ_Redis::connect('ccidlist'); }
/** * 保存验证号 * * @param string $code * @param int $lifeTime * @return boolean */ private function _saveCode($telephone, $code) { //---------------ocotpus update 2014-01-03---------------------------- //可以存在多个验证码,每个都可以验证 $redis = TZ_Redis::connect('user'); return $redis->set(self::$_preKey . $telephone . $code, time()); //-------------------------end----------------------------- }