/** * 是否有同步记录 * @param int $user_id 用户ID * @param int $app_id 应用ID * @param string $device_id 设备ID * @return bool */ public function has_history($user_id, $app_id, $device_id = '') { $key = $this->cache_pre . 'has_history_' . $user_id . '_' . $app_id . '_' . $device_id; $result = $this->cache->get($key); if (!$result) { $result = $this->contact_mapper->has_history($user_id, $app_id, $device_id); $this->cache->set($key, $result, NULL, 0); } return (bool) $result; }