public function showRenewalscost() { $json = stripcslashes($this->_GET['cost']); $data = json_decode($json, TRUE); $CustomersProjectID = $data['CustoProID']; $versiontime = $data['version']; unset($data['CustoProID']); unset($data['version']); $where = "where CustomersProjectID={$CustomersProjectID}"; //获取风信项目id $ProjectId = FENGXIN_ID; $where .= " and ProjectID={$ProjectId} and AgentID={$_SESSION['AgentID']}"; $AgentModule = new AgentModule(); $CustFuwuModule = new CustFuwuModule(); $FuWuModule = new FuWuModule(); //获取当前代理的等级 $Agentinfo = $AgentModule->GetOneInfoByKeyID($_SESSION['AgentID']); $LevelID['AgentPriceID'] = $Agentinfo['FengXinAgentPriceID']; //获取该等级的折扣 $AgentPriceModule = new AgentPriceModule(); $CustProModule = new CustProModule(); $AgentPriceinfo = $AgentPriceModule->GetOneInfoByArrayKeys($LevelID); $AgenDiscount = $AgentPriceinfo['AgenDiscount']; $CustProInfo = $CustProModule->GetInfoByWhere($where); if (!empty($CustProInfo)) { $cost = 0; $Endtime = date('Y-m-d', strtotime($CustProInfo['EndTime'])); $PropertyModule = new PropertyModule(); $PropertyInfo = $PropertyModule->GetOneInfoByKeyID($CustProInfo['GongNeng']); $MarketPrice = $PropertyInfo['MarketPrice']; if (strtotime($Endtime) < strtotime(date('Y-m-d'))) { $cost = (strtotime($versiontime) - strtotime(date('Y-m-d'))) / (3600 * 24) * $MarketPrice * $AgenDiscount / 365; } else { $cost = (strtotime($versiontime) - strtotime($Endtime)) / (3600 * 24) * $MarketPrice * $AgenDiscount / 365; } foreach ($data as $k => $v) { $FuWuInfo = $FuWuModule->GetOneInfoByKeyID($k); $FuWuPrice = $FuWuInfo['FuWuPrice']; $sql = "where CustomersProjectID={$CustomersProjectID} and FuWuID={$k}"; $CustFuwuInfo = $CustFuwuModule->GetInfoByWhere($sql); //dd($CustFuwuInfo); $FuwuEndTime = date('Y-m-d', strtotime($CustFuwuInfo['EndTime'])); if (strtotime($FuwuEndTime) < strtotime(date('Y-m-d'))) { $cost += (strtotime($v) - strtotime(date('Y-m-d'))) / (3600 * 24) * $FuWuPrice * $AgenDiscount / 365; } else { $cost += (strtotime($v) - strtotime($FuwuEndTime)) / (3600 * 24) * $FuWuPrice * $AgenDiscount / 365; } } } echo '此次续费将消费金额<span class="red font22">¥:' . round($cost) . '</span>'; exit; }
public function Lists() { $MysqlWhere = ' where 1'; $Page = intval($this->_GET['Page']); $Page = $Page ? $Page : 1; $FuWuModule = new FuWuModule(); $ListsNum = $FuWuModule->GetListsNum($MysqlWhere); $Rscount = $ListsNum['Num']; $PageSize = 1000; if ($Rscount) { $Data['RecordCount'] = $Rscount; $Data['PageSize'] = $PageSize ? $PageSize : $Data['RecordCount']; $Data['PageCount'] = ceil($Data['RecordCount'] / $PageSize); $Data['Page'] = min($Page, $Data['PageCount']); $Offset = ($Page - 1) * $Data['PageSize']; if ($Page > $Data['PageCount']) { $Page = $Data['PageCount']; } $Data['Data'] = $FuWuModule->GetLists($MysqlWhere, $Offset, $Data['PageSize']); MultiPage($Data, 10); $this->Data = $Data; } /* $aaaaa = ''; foreach ($Data['Data'] As $Value) { $aaaaa.="array ( 'id' =>'".$Value['FuWuID']."', 'name' => '".$Value['FuWuName']."', 'url' => '', ), "; } echo $aaaaa;exit; */ $FuWuID = _intval($this->_GET['FuWuID']); if ($FuWuID > 0) { $this->FuWuInfo = $FuWuModule->GetOneInfoByKeyID($FuWuID); } }