提交 93aae99c authored 作者: fengzy's avatar fengzy

'调整emfk'

上级 4a5fdb70
......@@ -62,7 +62,6 @@ class openemClassAction extends openapiAction
$new_array = array();
foreach($array as $k=>$v) {
$new_array[$k] = array_combine($key,$v);
}
echo "<pre>";
var_dump($new_array);
......@@ -73,25 +72,25 @@ class openemClassAction extends openapiAction
$sum += (int)$item['FPAYTOTALAMOUNTFOR'];
$payflow = $this->db->getone('[Q]c_emfk_paymentflow',"`fbillno`='".$new_array[$ke]['FBillNo']."'",'id,fbillno');
$fbillno=$new_array['FSRCBILLNO'];
$datalist = $this->db->getone('[Q]c_emfk',"`fbillno`='".$value['fbillno']."'",'id,fbillno,amountOfThisPayment');
$fbillno=$new_array['FBillNo'];
$datalist = $this->db->getone('[Q]c_emfk',"`fbillno`='".$value['fbillno']."'",'id,docnum,fbillno,amount');
if(!$payflow ){
$paymentflow=array(
'fsrcbillno' =>$new_array[$ke]['FSRCBILLNO'],
'docnum' =>$datalist['docnum'],
'fbillno' =>$new_array[$ke]['FBillNo'],
'fpaytotalamountfor' =>$new_array[$ke]['FPAYTOTALAMOUNTFOR'],
'mid' =>$datalist['id'],
'date' =>substr($new_array[$ke]['FPOSTDATE'],0,strpos($new_array[$ke]['FPOSTDATE'], 'T'))
);
m('finifom_oayfk_paymentflow')->insert($paymentflow);
m('c_emfk_paymentflow')->insert($paymentflow);
}
}
}
if($datalist['amountOfThisPayment']==$sum){
if($datalist['amount']==$sum){
m('c_fininfom_oayfk')->update('`status`=1',$datalist['id']);
m('c_emfk')->update('`status`=1',$datalist['id']);
$zfarr = array(
'status' =>1,
'nowcourseid' => 0,
......@@ -102,7 +101,7 @@ class openemClassAction extends openapiAction
m('flow_bill')->update($zfarr,'mid='.$datalist['id'].'');
$addarr = array(
'table' => 'c_fininfom_oayfk',
'table' => 'c_emfk',
'mid' => $datalist['id'],
'status' => 1,
'statusname' => '同意',
......@@ -129,31 +128,31 @@ class openemClassAction extends openapiAction
}else{
$key = ['FSRCBILLNO','FBillNo','FDOCUMENTSTATUS','FPAYTOTALAMOUNTFOR','FPOSTDATE' ];
$key = ['FBillNo','FDOCUMENTSTATUS','FPAYTOTALAMOUNTFOR','FPOSTDATE' ];
$new_array = array();
foreach($array as $k=>$v) {
$new_array= array_combine($key,$v);
}
$fbillno=$new_array['FSRCBILLNO'];
$datalist = $this->db->getone('[Q]c_fininfom_oayfk',"`fbillno`='".$fbillno."'",'id,fbillno,amountOfThisPayment');
$fbillno=$new_array['FBillNo'];
$datalist = $this->db->getone('[Q]c_emfk',"`fbillno`='".$fbillno."'",'id,docnum,fbillno,amount');
if($new_array['FDOCUMENTSTATUS']=='C'){
$payflow = $this->db->getone('[Q]finifom_oayfk_paymentflow',"`fbillno`='".$new_array['FBillNo']."'",'id,fbillno');
$payflow = $this->db->getone('[Q]c_emfk_paymentflow',"`fbillno`='".$new_array['FBillNo']."'",'id,fbillno');
if(!$payflow ){
$paymentflow=array(
'fsrcbillno' =>$new_array['FSRCBILLNO'],
'docnum' =>$datalist['docnum'],
'fbillno' =>$new_array['FBillNo'],
'fpaytotalamountfor' =>$new_array['FPAYTOTALAMOUNTFOR'],
'mid' =>$datalist['id'],
'date' =>substr($new_array['FPOSTDATE'],0,strpos($new_array['FPOSTDATE'], 'T'))
);
m('finifom_oayfk_paymentflow')->insert($paymentflow);
m('c_emfk_paymentflow')->insert($paymentflow);
}
if($datalist['amountOfThisPayment']==$new_array['FPAYTOTALAMOUNTFOR']){
m('c_fininfom_oayfk')->update('`status`=1',$datalist['id']);
if($datalist['amount']==$new_array['FPAYTOTALAMOUNTFOR']){
m('c_emfk')->update('`status`=1',$datalist['id']);
$zfarr = array(
'status' =>1,
'nowcourseid' => 0,
......@@ -164,7 +163,7 @@ class openemClassAction extends openapiAction
m('flow_bill')->update($zfarr,'mid='.$datalist['id'].'');
$addarr = array(
'table' => 'c_fininfom_oayfk',
'table' => 'c_emfk',
'mid' => $datalist['id'],
'status' => 1,
'statusname' => '同意',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论