提交 dd10850c authored 作者: fengzy's avatar fengzy

合同收款方

上级 7caaa332
...@@ -48,6 +48,13 @@ class mode_contract_listClassAction extends inputAction{ ...@@ -48,6 +48,13 @@ class mode_contract_listClassAction extends inputAction{
$sql = ' number = "'.$numb .'"'; $sql = ' number = "'.$numb .'"';
$cdata = m($model)->getone($sql,'id,name'); $cdata = m($model)->getone($sql,'id,name');
if(empty($cdata)){
$model = 'customer';
$sql = ' contract_number = "'.$numb .'"';
$cdata = m($model)->getone($sql,'id,name');
}
if($cdata){ if($cdata){
$sql = "select CONCAT('开户银行: ',`open_bank_name` ,' -- 银行账号: ',`bank_code` ) as `name`,`bank_code` as `value` from [Q]".$model."_bank_info where mid = ".$cdata['id']; $sql = "select CONCAT('开户银行: ',`open_bank_name` ,' -- 银行账号: ',`bank_code` ) as `name`,`bank_code` as `value` from [Q]".$model."_bank_info where mid = ".$cdata['id'];
$data = $this->db->getall($sql); $data = $this->db->getall($sql);
...@@ -125,24 +132,49 @@ class mode_contract_listClassAction extends inputAction{ ...@@ -125,24 +132,49 @@ class mode_contract_listClassAction extends inputAction{
public function getparta(){ public function getparta(){
$receive = $this->get('receive'); $receive = $this->get('receive');
//如果financetype值等于1说明是成本合同 甲方是客户 乙方 第三方 都是供应商
//如果financetype值等于2说明是收入合同 甲方 、第三方 都是供应商 乙方是客户
// if($receive == 1){ //如果甲方收款 供应商
// $data = m('common')->getsupplier();
// } elseif($receive == 2) { //乙方收款
// $data = m('common')->getcustomer();
// } else{
$customer = m('common')->getcontract_customer(); $customer = m('common')->getcontract_customer();
$supplier = m('common')->getcontract_supplier(); $supplier = m('common')->getcontract_supplier();
$data=array_merge($customer,$supplier); $data=array_merge($customer,$supplier);
// }
$this->returnjson($data); $this->returnjson($data);
} }
public function getpartb(){ public function getpartb(){
$receive = $this->get('receive'); $receive = $this->get('receive');
$data = [];
// if($receive == 1){ //如果甲方收款
// $data = m('common')->getcustomer();
// } elseif($receive == 2) { //乙方收款 乙方就是供应商
// $data = m('common')->getsupplier();
// } else{
$customer = m('common')->getcontract_customer(); $customer = m('common')->getcontract_customer();
$supplier = m('common')->getcontract_supplier(); $supplier = m('common')->getcontract_supplier();
$data=array_merge($customer,$supplier); $data=array_merge($customer,$supplier);
// }
$this->returnjson($data); $this->returnjson($data);
} }
public function getpartc(){ public function getpartc(){
// $receive = $this->get('receive');
// $data=[];
// if($receive == 3){
$customer = m('common')->getcontract_customer(); $customer = m('common')->getcontract_customer();
$supplier = m('common')->getcontract_supplier(); $supplier = m('common')->getcontract_supplier();
$data=array_merge($customer,$supplier); $data=array_merge($customer,$supplier);
// }
$this->returnjson($data); $this->returnjson($data);
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论