本文整理汇总了PHP中Application_Model_DbTable_DbGlobal::CountDayByDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Application_Model_DbTable_DbGlobal::CountDayByDate方法的具体用法?PHP Application_Model_DbTable_DbGlobal::CountDayByDate怎么用?PHP Application_Model_DbTable_DbGlobal::CountDayByDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application_Model_DbTable_DbGlobal
的用法示例。
在下文中一共展示了Application_Model_DbTable_DbGlobal::CountDayByDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upDateLoanDisburse
//.........这里部分代码省略.........
$this->_name='ln_loanmember_funddetail';
for($j=1;$j<=$loop_payment;$j++){
//return amount next day collection
$amount_collect = $data['amount_collect'];
$day_perterm = $dbtable->getSubDaysByPaymentTerm($data['collect_termtype'],$amount_collect);//return amount day for payterm
//$day_perterm = $dbtable->getSubDaysByPaymentTerm($data['pay_every'],$amount_collect);//return amount day for payterm
$str_next = $dbtable->getNextDateById($data['collect_termtype'],$data['amount_collect']);//for next,day,week,month;
if($payment_method==1){//decline//completed
// $pri_permonth = ($data['debt_amount'.$j]/($data['period']-$data['graice_pariod'])*$amount_collect);
$pri_permonth = $data['debt_amount'.$i]/(($amount_borrow_term-($data['graice_pariod']*$borrow_term))/$amount_fund_term);
$pri_permonth = $this->round_up_currency($curr_type, $pri_permonth);
if($j*$amount_collect<=$data['graice_pariod']){//check here//for graice period
$pri_permonth = 0;
}
if($j!=1){
if($data['graice_pariod']!=0){//if collect =1 not other check
if($j*$amount_collect>$data['graice_pariod']+$amount_collect){//not wright
$remain_principal = $remain_principal-$pri_permonth;
}else{
}
}else{
$remain_principal = $remain_principal-$pri_permonth;//OSប្រាក់ដើមគ្រា}
}
if($j==$loop_payment){//check condition here//for end of record only
$pri_permonth = $data['debt_amount'.$i]-$pri_permonth*($j-(($data['graice_pariod']/$amount_collect)+1));//code error here
}
$start_date = $next_payment;
$next_payment = $dbtable->getNextPayment($str_next, $next_payment, $data['amount_collect'],$data['every_payamount']);
$amount_day = $dbtable->CountDayByDate($start_date,$next_payment);
$interest_paymonth = $remain_principal*((($amount_fund_term*$data['interest_rate'])/$borrow_term)/100)*($amount_day/$day_perterm);
}else{
$next_payment = $data['first_payment'];
$amount_day = $dbtable->CountDayByDate($start_date,$next_payment);
$interest_paymonth = ($data['debt_amount'.$i])*((($amount_fund_term*$data['interest_rate'])/$borrow_term)/100)*($amount_day/$day_perterm);
}
}elseif($payment_method==2){//baloon
$pri_permonth=0;
if(($j*$amount_fund_term)==$amount_borrow_term){//end record//if j == loop
$pri_permonth = $data['debt_amount'.$i];
$remain_principal = $pri_permonth;//$remain_principal-$pri_permonth;//OSប្រាក់ដើមគ្រា
}
if($j!=1){
$start_date = $next_payment;
$next_payment = $dbtable->getNextPayment($str_next, $next_payment, $data['amount_collect'],$data['every_payamount']);
$amount_day = $dbtable->CountDayByDate($start_date,$next_payment);
// $interest_paymonth = $data['debt_amount'.$i]*($data['interest_rate']/100)*($amount_day/$day_perterm);
}else{
$next_payment = $data['first_payment'];//$dbtable->getNextPayment($str_next, $start_date, $data['amount_collect'],$data['every_payamount']);
$amount_day = $dbtable->CountDayByDate($start_date,$next_payment);
}
$interest_paymonth = $data['debt_amount'.$i]*((($amount_fund_term*$data['interest_rate'])/$borrow_term)/100)*($amount_day/$day_perterm);
}elseif($payment_method==3){//fixed rate
$pri_permonth = ($data['debt_amount'.$i]/($amount_borrow_term/$amount_fund_term));
$pri_permonth =$this->round_up_currency($curr_type,$pri_permonth);
if($j!=1){
$remain_principal = $remain_principal-$pri_permonth;//OSប្រាក់ដើមគ្រា
if($i==$loop_payment){//for end of record only
$pri_permonth = $remain_principal;
示例2: addNewLoanILTest
//.........这里部分代码省略.........
$loop_payment = ($amount_borrow_term)/($amount_fund_term);
$payment_method = $data['repayment_method'];
// for($i=1;$i<=($data['period']/$data['amount_collect']);$i++){
for($i=1;$i<=$loop_payment;$i++){
$amount_collect = $data['amount_collect'];
$day_perterm = $dbtable->getSubDaysByPaymentTerm($data['collect_termtype'],$amount_collect);//return amount day for payterm
$str_next = $dbtable->getNextDateById($data['collect_termtype'],$data['amount_collect']);//for next,day,week,month;
if($payment_method==1){//decline//completed
// $pri_permonth = ($data['total_amount']/($data['period']-$data['graice_pariod'])*$amount_collect);
$pri_permonth = $data['total_amount']/(($amount_borrow_term-($data['graice_pariod']*$borrow_term))/$amount_fund_term);
$pri_permonth = $this->round_up_currency($curr_type, $pri_permonth);
if($i*$amount_collect<=$data['graice_pariod']){//check here//for graice period
$pri_permonth = 0;
}
if($i!=1){
if($data['graice_pariod']!=0){//if collect =1 not other check
if($i*$amount_collect>$data['graice_pariod']+$amount_collect){//not wright
$remain_principal = $remain_principal-$pri_permonth;
}else{
}
}else{
$remain_principal = $remain_principal-$pri_permonth;//OSប្រាក់ដើមគ្រា}
}
if($i==$loop_payment){//check condition here//for end of record only
// echo $remain_principal;
$pri_permonth = $data['total_amount']-$pri_permonth*($i-(($data['graice_pariod']/$amount_collect)+1));//code error here
}
$start_date = $next_payment;
$next_payment = $dbtable->getNextPayment($str_next, $next_payment, $data['amount_collect'],$data['every_payamount'],$data['first_payment']);
$amount_day = $dbtable->CountDayByDate($start_date,$next_payment);
$interest_paymonth = $remain_principal*($data['interest_rate']/100/$borrow_term)*$amount_day;
// $interest_paymonth = $remain_principal*((($amount_fund_term*$data['interest_rate'])/$borrow_term)/100)*($amount_day/$day_perterm);
}else{
$next_payment = $data['first_payment'];
$amount_day = $dbtable->CountDayByDate($start_date,$next_payment);
$interest_paymonth = $remain_principal*($data['interest_rate']/100/$borrow_term)*$amount_day;
// $interest_paymonth = $data['total_amount']*((($amount_fund_term*$data['interest_rate'])/$borrow_term)/100)*($amount_day/$day_perterm);
}
}elseif($payment_method==2){//baloon
$pri_permonth=0;
if(($i*$amount_fund_term)==$amount_borrow_term){//check here
$pri_permonth = ($curr_type==1)?round($data['total_amount'],-2):$data['total_amount'];
$pri_permonth =$this->round_up_currency($curr_type, $pri_permonth);
$remain_principal = $pri_permonth;//$remain_principal-$pri_permonth;//OSប្រាក់ដើមគ្រា
}
if($i!=1){
$start_date = $next_payment;
$next_payment = $dbtable->getNextPayment($str_next, $next_payment, $data['amount_collect'],$data['every_payamount'],$data['first_payment']);
$amount_day = $dbtable->CountDayByDate($start_date,$next_payment);
}else{
$next_payment = $data['first_payment'];
$amount_day = $dbtable->CountDayByDate($start_date,$next_payment);
}
$interest_paymonth = $data['total_amount']*($data['interest_rate']/100/$borrow_term)*$amount_day;
// $interest_paymonth = $data['total_amount']*((($amount_fund_term*$data['interest_rate'])/$borrow_term)/100)*($amount_day/$day_perterm);
}elseif($payment_method==3){//fixed rate
$pri_permonth = ($data['total_amount']/($amount_borrow_term/$amount_fund_term));
$pri_permonth =$this->round_up_currency($curr_type,$pri_permonth);
if($i!=1){
示例3: updateLoanById
//.........这里部分代码省略.........
$fund_term = $dbtable->getSubDaysByPaymentTerm($data['collect_termtype'],null);//return amount day for payterm
$amount_fund_term = $fund_term*$data['amount_collect'];
$loop_payment = ($amount_borrow_term)/($amount_fund_term);
$payment_method = $data['repayment_method'];
// for($i=1;$i<=($data['period']/$data['amount_collect']);$i++){
for($i=1;$i<=$loop_payment;$i++){
$amount_collect = $data['amount_collect'];
$str_next = $dbtable->getNextDateById($data['collect_termtype'],$data['amount_collect']);//for next,day,week,month;
if($payment_method==1){//decline//completed
// $pri_permonth = ($data['total_amount']/($data['period']-$data['graice_pariod'])*$amount_collect);
$pri_permonth = $data['total_amount']/(($amount_borrow_term-($data['graice_pariod']*$borrow_term))/$amount_fund_term);
$pri_permonth = $this->round_up_currency($curr_type, $pri_permonth);
if($i*$amount_collect<=$data['graice_pariod']){//check here//for graice period
$pri_permonth = 0;
}
if($i!=1){
if($data['graice_pariod']!=0){//if collect =1 not other check
if($i*$amount_collect>$data['graice_pariod']+$amount_collect){//not wright
$remain_principal = $remain_principal-$pri_permonth;
}else{
}
}else{
$remain_principal = $remain_principal-$pri_permonth;//OSប្រាក់ដើមគ្រា}
}
if($i==$loop_payment){//check condition here//for end of record only
$pri_permonth = $data['total_amount']-$pri_permonth*($i-(($data['graice_pariod']/$amount_collect)+1));//code error here
}
$start_date = $next_payment;
$next_payment = $dbtable->getNextPayment($str_next, $next_payment, $data['amount_collect'],$data['every_payamount'],$data['first_payment']);
$amount_day = $dbtable->CountDayByDate($from_date,$next_payment);
$interest_paymonth = $remain_principal*($data['interest_rate']/100/$borrow_term)*$amount_day;
}else{
$next_payment = $data['first_payment'];
$next_payment = $dbtable->checkFirstHoliday($next_payment,$data['every_payamount']);
$amount_day = $dbtable->CountDayByDate($from_date,$next_payment);
$interest_paymonth = $remain_principal*($data['interest_rate']/100/$borrow_term)*$amount_day;
}
}elseif($payment_method==2){//baloon
$pri_permonth=0;
if(($i*$amount_fund_term)==$amount_borrow_term){//check here
$pri_permonth = ($curr_type==1)?round($data['total_amount'],-2):$data['total_amount'];
$pri_permonth =$this->round_up_currency($curr_type, $pri_permonth);
$remain_principal = $pri_permonth;//$remain_principal-$pri_permonth;//OSប្រាក់ដើមគ្រា
}
if($i!=1){
$start_date = $next_payment;
$next_payment = $dbtable->getNextPayment($str_next, $next_payment, $data['amount_collect'],$data['every_payamount'],$data['first_payment']);
$amount_day = $dbtable->CountDayByDate($from_date,$next_payment);
}else{
$next_payment = $data['first_payment'];
$next_payment = $dbtable->checkFirstHoliday($next_payment,$data['every_payamount']);
$amount_day = $dbtable->CountDayByDate($from_date,$next_payment);
}
$interest_paymonth = $data['total_amount']*($data['interest_rate']/100/$borrow_term)*$amount_day;
}elseif($payment_method==3){//fixed rate
$pri_permonth = ($data['total_amount']/($amount_borrow_term/$amount_fund_term));
$pri_permonth =$this->round_up_currency($curr_type,$pri_permonth);
if($i!=1){
$remain_principal = $remain_principal-$pri_permonth;//OSប្រាក់ដើមគ្រា
if($i==$loop_payment){//for end of record only