Import.class.php 3.23 KB
<?php
/**
 * 数据导入
 * 
 * @name Service_Import
 * @package service
 * @copyright yoho.inc
 * @version 5.0 (2014-3-14 13:47:57)
 * @author whb <huanbao.wang@yoho.cn>
 */
class Service_Import extends Lib_Service
{
	const ROUTER = 'import.yh_history.import';
	
	public function getUserProfile($offset, $limit)
	{
		$params = array('offset'=> $offset, 'limit' => $limit);
		return self::service(self::ROUTER)->cache(false)->fetchAssoc('getUserProfile', $params);
	}
	
	public function getUserProfileTotal()
	{
		return self::service(self::ROUTER)->cache(false)->fetchOne('getUserProfileTotal');
	}
	
	public function getUserBase($uid)
	{
		return self::service(self::ROUTER)->cache(false)->fetchRow('getUserBase', array('uid' => $uid));
	}
	
	public function setYohobuyLog($yohobuy_uid, $sso_uid, $import_status)
	{
		$params = array('yohobuy_uid' => $yohobuy_uid, 'sso_uid'=> $sso_uid, 
				'import_status' => $import_status, 'create_time' => time());
		return self::service(self::ROUTER)->cache(false)->insert('setYohobuyLog', $params)->status();
	}
	
	public function setYohobuyPartnerLog($yohobuy_uid, $sso_uid, $open_id, $import_status)
	{
		$params = array('yohobuy_uid' => $yohobuy_uid, 'sso_uid'=> $sso_uid,'open_id'=>$open_id, 'import_status' => $import_status, 'create_time' => time());
		return self::service(self::ROUTER)->cache(false)->insert('setYohobuyPartnerLog', $params)->status();
	}
	public function getYohobuyLogTotal()
	{
		return self::service(self::ROUTER)->cache(false)->fetchOne('getYohobuyLogTotal');
	}
	public function getYohobuyLog($yohobuy_uid)
	{
		return self::service(self::ROUTER)->cache(false)->fetchRow('getYohobuyLog', array('yohobuy_uid' => $yohobuy_uid));
	}
	
	public function getYohobuyOpenIdByUid($uid)
	{
		return self::service(self::ROUTER)->cache(false)->fetchAssoc('getYohobuyOpenIdByUid', array('uid' => $uid));
	}
	
	public function getShowPartner($offset, $limit)
	{
		return self::service(self::ROUTER)->cache(false)->fetchAssoc('getShowPartner', array('offset'=> $offset, 'limit' => $limit));
	}
	
	public function getShowMemberBasic($uid)
	{
		return self::service(self::ROUTER)->cache(false)->fetchRow('getShowMemberBasic', array('uid' => $uid));
	}
	
	public function setShowPartnerLog($show_uid, $sso_uid, $import_status)
	{
		$params = array('show_uid' => $show_uid, 'sso_uid'=> $sso_uid,'import_status' => $import_status, 'create_time' => time());
		return self::service(self::ROUTER)->cache(false)->insert('setShowPartnerLog', $params)->status();
	}
	
	public function getYohoMember($offset, $limit)
	{
		$params = array('offset'=> $offset, 'limit' => $limit);
		return self::service(self::ROUTER)->cache(false)->fetchAssoc('getYohoMember', $params);
	}
	
	public function getYohoMobile($uid)
	{
		return self::service(self::ROUTER)->cache(false)->fetchRow('getYohoMobile', array('uid' => $uid));	
	}
	
	public function getYohoPartner($uid)
	{
		return self::service(self::ROUTER)->cache(false)->fetchRow('getYohoPartner', array('uid' => $uid));
	}
	
	public function setYohoLog($yoho_uid, $sso_uid, $import_status)
	{
		$params = array('yoho_uid' => $yoho_uid, 'sso_uid'=> $sso_uid,'import_status' => $import_status, 'create_time' => time());
		return self::service(self::ROUTER)->cache(false)->insert('setYohoLog', $params)->status();
	}
}