CurrencyController.php 2.12 KB
<?php

class Home_CurrencyController extends QLib_Controller_Home_Action
{
	public function init()
	{ 
		$this->QLayoutTitle()->headTitle('YOHO币使用记录');
		$this->QLayoutScript()->offsetSetFile(60, $this->_js('jqueryui'))->offsetSetFile(61, $this->_js('global'))->offsetSetFile(62,$this->_js('user_main'))->offsetSetFile(63,$this->_js('currency'));
		
		$this->QLayoutLink()->offsetSetStylesheet(25, $this->_css('common'))->offsetSetStylesheet(26, $this->_css('myyoho'))->offsetSetStylesheet(27, $this->_css('jqueryuicss'));
		
	}
	
	public function indexAction(){
	    $checkedList = QINOperations_Models_Showthing_Client::getCanReturnByUid($this->uid);
	    $recommendList = QINOperations_Models_Showthing_Client::getCanReturnByUid($this->uid, 2);
	    $this->view->recommend = $recommend = count($recommendList);
	    $this->view->checked = $checked = count($checkedList);
	    $this->view->total = (($recommend*5) + ($checked*5));
		$this->view->page = $page = $this->helpPaging("yohojs")->setFJs('getCurrency')->setTotal(QINPassport_Models_Yohocoinlog_Client::getTotalByUID($this->uid))->setSize(10);
		$this->view->list = $list = QINPassport_Models_Yohocoinlog_Client::getUserList($this->uid, $page->getOffset(), $page->getSize());	
		
	}
	
	public function listAction(){
		$this->_helper->layout()->disableLayout();
		$this->view->page = $page = $this->helpPaging("yohojs")->setFJs('getCurrency')->setTotal(QINPassport_Models_Yohocoinlog_Client::getTotalByUID($this->uid))->setSize(10);
		$this->view->list = $list = QINPassport_Models_Yohocoinlog_Client::getUserList($this->uid, $page->getOffset(), $page->getSize());
	}
	
	/**
	 * 获取yoho币
	 */
	public function getyohocoinAction() {
		$num = QINPassport_Currency::getCurYohoCoin($this->uid);
		$this->helpJsonResult(200, 'yoho币数量', array('num' => $num));
	}
	
	public function yohoshowAction()
	{
	    $checkedList = QINOperations_Models_Showthing_Client::getCanReturnByUid($this->uid);
	    $recommendList = QINOperations_Models_Showthing_Client::getCanReturnByUid($this->uid, 2);
	    $this->view->recommend = count($recommendList);
	    $this->view->checked = count($checkedList);
	}
}