public static function liebiao($model) {
$table = '';
$str = '<tr>%s</tr>';
$td = "<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td>";
//借款成本
$numClients = $model->billcount - 1;
for ($i = 0; $i < $numClients; $i++) {
list($y, $m, $d) = explode('-', $model->firstDate);
if ($d <= 15) {
$_mk = mktime(0, 0, 0, ((int) $m) + $i, 15, (int) $y);
//$_newDate = date("Y-m-d", $_mk);
} else {
$mk = mktime(0, 0, 0, ((int) $m) + $i, $d, (int) $y);
$newDate = date("Y-m-d", $mk);
list($_y, $_m, $_d) = explode('-', $newDate);
if ($_m == "02" || $_m == "2") {
$_mk = mktime(0, 0, 0, ((int) $_m), 28, (int) $_y);
} else if ($_m == "03" && $_d == "02") {
$_mk = mktime(0, 0, 0, ((int) 02), 28, (int) $_y);
} else {
$_mk = mktime(0, 0, 0, ((int) $_m), $_d, (int) $_y);
}
}
$Date_1 = $Date_1 = date("Y-m-d", $_mk);
$Date_2 = $model->generatedRightDate;
$d1 = strtotime($Date_1);
$d2 = strtotime($Date_2);
$Days = round(($d1 - $d2) / 3600 / 24);
// isset($results[0]['totalPaymentAmt']) ? '是■否□' : '是□否■';
if (mb_substr(Combox::getComboxName("回收方式", $model->recycleType), 0, 3) == "月月盈") {
$_shouyi = $model->investAmt;
} else {
$shouyi = $model->investAmt + ($model->investAmt * ($model->recycleType / 100) / 360 * $Days);
$_shouyi = sprintf("%01.2f", $shouyi);
}
$borrAmt = ContractPrint::againSummuryBorrowsPayAmt($model, date("Y-m-d", $_mk));
//
// $yueAmt = $borrAmt - ContractPrint::tmonthAmt($model);
if (mb_substr(Combox::getComboxName("回收方式", $model->recycleType), 0, 3) == "月月盈" && $i == 0) {
list($by, $bm, $bd) = explode('-', $model->firstDate);
list($ty, $tm, $_td) = explode('-', $model->generatedRightDate);
//---------------------
$_mk = mktime(0, 0, 0, ((int) $bm), $bd, (int) $by);
$Date_1 = date("Y-m-d", $_mk);
$_d1 = strtotime($Date_1);
$_d2 = strtotime($model->generatedRightDate);
$_Days = round(($_d1 - $_d2) / 3600 / 24);
$_monthAmt = $model->investAmt * ($model->recycleType / 100) / 360 * $_Days;
$tds = sprintf($td, date("Y-m-d", $_mk), $borrAmt, $borrAmt, 0, '0%', 0, $borrAmt - $_monthAmt, $_monthAmt, $_shouyi);
} else if (mb_substr(Combox::getComboxName("回收方式", $model->recycleType), 0, 3) == "月月盈") {
$tds = sprintf($td, date("Y-m-d", $_mk), $borrAmt, $borrAmt, 0, '0%', 0, $borrAmt - ContractPrint::tmonthAmt($model), ContractPrint::tmonthAmt($model), $_shouyi);
} else {
$tds = sprintf($td, date("Y-m-d", $_mk), $borrAmt, $borrAmt, 0, '0%', 0, $borrAmt, 0, $_shouyi);
}
// $_monthShouyi=ContractPrint::againPayAmt($model)-ContractPrint::monthAmt($model);
// $_AMT=$borrAmt-$_monthShouyi;
// $tds = sprintf($td, date("Y-m-d", $_mk), $borrAmt, $borrAmt, 0, '0%', $_AMT, $_monthShouyi, 0, $_shouyi);
$table .= sprintf($str, $tds);
}
return $table;
// $_sql = "select min(rightMonthNo) as months from rah_rightmatch where lendInvestID='$model->lendInvestID'";
// $_command = Yii::app()->db->createCommand($_sql);
// $_results = $_command->queryAll();
// $_numClients = (int) $_results[0]["months"];
//
// list($y, $m, $d) = explode('-', $_numClients);
//
//
//
// for ($i = 0; $i < $numClients; $i++) {
// $tds = '';
//
// $shouyiri = date("Y-m-d", mktime(0, 0, 0, ((int) $m) + i, $d, (int) $y));
//
//
// $table = '';
// $str = '<tr>%s</tr>';
// $td = "<td>%d</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td>";
//
// $tds.= sprintf($td, $i,$shouyiri, 0, 0, 0, 0, 0, $numClients-$i, 0);
//
//
// $table .= sprintf($str, $tds);
// }
// return $table;
}
$table = '';
$str = '<tr>%s</tr>';
$td = "<td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td>";
//借款成本
$numClients = $model->billcount - 1;
for ($i = 0; $i < $numClients; $i++) {
list($y, $m, $d) = explode('-', $model->firstDate);
if ($d <= 15) {
$_mk = mktime(0, 0, 0, ((int) $m) + $i, 15, (int) $y);
//$_newDate = date("Y-m-d", $_mk);
} else {
$mk = mktime(0, 0, 0, ((int) $m) + $i, $d, (int) $y);
$newDate = date("Y-m-d", $mk);
list($_y, $_m, $_d) = explode('-', $newDate);
if ($_m == "02" || $_m == "2") {
$_mk = mktime(0, 0, 0, ((int) $_m), 28, (int) $_y);
} else if ($_m == "03" && $_d == "02") {
$_mk = mktime(0, 0, 0, ((int) 02), 28, (int) $_y);
} else {
$_mk = mktime(0, 0, 0, ((int) $_m), $_d, (int) $_y);
}
}
$Date_1 = $Date_1 = date("Y-m-d", $_mk);
$Date_2 = $model->generatedRightDate;
$d1 = strtotime($Date_1);
$d2 = strtotime($Date_2);
$Days = round(($d1 - $d2) / 3600 / 24);
// isset($results[0]['totalPaymentAmt']) ? '是■否□' : '是□否■';
if (mb_substr(Combox::getComboxName("回收方式", $model->recycleType), 0, 3) == "月月盈") {
$_shouyi = $model->investAmt;
} else {
$shouyi = $model->investAmt + ($model->investAmt * ($model->recycleType / 100) / 360 * $Days);
$_shouyi = sprintf("%01.2f", $shouyi);
}
$borrAmt = ContractPrint::againSummuryBorrowsPayAmt($model, date("Y-m-d", $_mk));
//
// $yueAmt = $borrAmt - ContractPrint::tmonthAmt($model);
if (mb_substr(Combox::getComboxName("回收方式", $model->recycleType), 0, 3) == "月月盈" && $i == 0) {
list($by, $bm, $bd) = explode('-', $model->firstDate);
list($ty, $tm, $_td) = explode('-', $model->generatedRightDate);
//---------------------
$_mk = mktime(0, 0, 0, ((int) $bm), $bd, (int) $by);
$Date_1 = date("Y-m-d", $_mk);
$_d1 = strtotime($Date_1);
$_d2 = strtotime($model->generatedRightDate);
$_Days = round(($_d1 - $_d2) / 3600 / 24);
$_monthAmt = $model->investAmt * ($model->recycleType / 100) / 360 * $_Days;
$tds = sprintf($td, date("Y-m-d", $_mk), $borrAmt, $borrAmt, 0, '0%', 0, $borrAmt - $_monthAmt, $_monthAmt, $_shouyi);
} else if (mb_substr(Combox::getComboxName("回收方式", $model->recycleType), 0, 3) == "月月盈") {
$tds = sprintf($td, date("Y-m-d", $_mk), $borrAmt, $borrAmt, 0, '0%', 0, $borrAmt - ContractPrint::tmonthAmt($model), ContractPrint::tmonthAmt($model), $_shouyi);
} else {
$tds = sprintf($td, date("Y-m-d", $_mk), $borrAmt, $borrAmt, 0, '0%', 0, $borrAmt, 0, $_shouyi);
}
// $_monthShouyi=ContractPrint::againPayAmt($model)-ContractPrint::monthAmt($model);
// $_AMT=$borrAmt-$_monthShouyi;
// $tds = sprintf($td, date("Y-m-d", $_mk), $borrAmt, $borrAmt, 0, '0%', $_AMT, $_monthShouyi, 0, $_shouyi);
$table .= sprintf($str, $tds);
}
return $table;
// $_sql = "select min(rightMonthNo) as months from rah_rightmatch where lendInvestID='$model->lendInvestID'";
// $_command = Yii::app()->db->createCommand($_sql);
// $_results = $_command->queryAll();
// $_numClients = (int) $_results[0]["months"];
//
// list($y, $m, $d) = explode('-', $_numClients);
//
//
//
// for ($i = 0; $i < $numClients; $i++) {
// $tds = '';
//
// $shouyiri = date("Y-m-d", mktime(0, 0, 0, ((int) $m) + i, $d, (int) $y));
//
//
// $table = '';
// $str = '<tr>%s</tr>';
// $td = "<td>%d</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td>";
//
// $tds.= sprintf($td, $i,$shouyiri, 0, 0, 0, 0, 0, $numClients-$i, 0);
//
//
// $table .= sprintf($str, $tds);
// }
// return $table;
}