public function actionRecharge() { $data = array(); $attr = array('condition' => 'user_id = :user_id', 'params' => array(':user_id' => $this->user['id'])); $userProBuyList = $this->userProductBuy_model->findAll($attr); $sumBuyVal = 0.0; foreach ($userProBuyList as $userProVal) { $buyPro = $userProVal->getAttributes(); $sumBuyVal += $buyPro['buy_val']; } $data['sumBuyVal'] = $sumBuyVal; $dType = $this->request->getParam('dType'); $rType = $this->request->getParam('rType'); $dTime = FConfig::item('config.time_type.' . $dType); if ($rType == 3) { //分页参数 $page = $this->request->getParam('page') > 0 ? (int) $this->request->getParam('page') : 1; $page_size = $this->request->getParam('size') > 0 ? (int) $this->request->getParam('size') : FConfig::item('config.pageSize'); $where = "1=1"; $where .= " and user_id = {$this->user['id']}"; if (!empty($dType)) { $where .= " and create_time >= :create_time"; $data['dType'] = $dType; } $condition_arr = array('condition' => $where, 'order' => 'create_time DESC', 'limit' => $page_size, 'offset' => ($page - 1) * $page_size); $condition_arr['params'] = array(); if (!empty($dType)) { $condition_arr['params'][':create_time'] = $dTime; } $data['cashList'] = $this->withdrawCash_model->findAll($condition_arr); $data['count'] = $this->withdrawCash_model->count($condition_arr); $pages = new FPagination($data['count']); $pages->setPageSize($page_size); $pages->setCurrent($page); $pages->makePages(); $data['page'] = $pages; } //分页参数 $page = $this->request->getParam('page') > 0 ? (int) $this->request->getParam('page') : 1; $page_size = $this->request->getParam('size') > 0 ? (int) $this->request->getParam('size') : FConfig::item('config.pageSize'); $where = "1=1"; $where .= " and user_id = {$this->user['id']} and trade_status=1"; if (!empty($rType)) { $where .= " and trade_type = :trade_type"; $data['rType'] = $rType; } if (!empty($dType)) { $where .= " and trade_time >= :trade_time"; $data['dType'] = $dType; } $condition_arr = array('condition' => $where, 'order' => 'trade_time DESC', 'limit' => $page_size, 'offset' => ($page - 1) * $page_size); $condition_arr['params'] = array(); if (!empty($dType)) { $condition_arr['params'][':trade_time'] = $dTime; } $tType = FConfig::item("config.r_type." . $rType); if (!empty($rType)) { $condition_arr['params'][':trade_type'] = FConfig::item("config.trade_type." . $tType); } $data['tradeList'] = $this->tradingRecord_model->findAll($condition_arr); $data['count'] = $this->tradingRecord_model->count($condition_arr); $pages = new FPagination($data['count']); $pages->setPageSize($page_size); $pages->setCurrent($page); $pages->makePages(); $data['tradeList'] = $this->tradingRecord_model->findAll($condition_arr); $data['page'] = $pages; $this->render('recharge', $data); }