Commit 7709f748 authored by hujun's avatar hujun

统计是否开业

parent 4ec8cd17
...@@ -994,9 +994,9 @@ class Finance extends Basic ...@@ -994,9 +994,9 @@ class Finance extends Basic
//案场费和中介费是否开业 //案场费和中介费是否开业
if (isset($this->params['is_open'])) { if (isset($this->params['is_open'])) {
if ($this->params['is_open'] == 1) { if ($this->params['is_open'] == 1) {
$where['f.is_open'] = 1; $where['d.is_open'] = 1;
} else { } else {
$where['f.is_open'] = 0; $where['d.is_open'] = 0;
} }
if (!isset($where['a.type'])) { if (!isset($where['a.type'])) {
...@@ -4303,7 +4303,7 @@ class Finance extends Basic ...@@ -4303,7 +4303,7 @@ class Finance extends Basic
$data['intention_refund'] += $this->sumPayLogRefundByType(1, 0, 0, $where);//意向金退款 $data['intention_refund'] += $this->sumPayLogRefundByType(1, 0, 0, $where);//意向金退款
$data['intention_refund'] = round($data['intention_refund'], 2); $data['intention_refund'] = round($data['intention_refund'], 2);
//意向金入账-意向金调整-意向金退款 //意向金入账-意向金调整-意向金退款
$data['total_intention_recorded'] = $data['intention_recorded'] - $data['intention_adjustment'] - $data['intention_refund']; //账上意向金 $data['total_intention_recorded'] = sprintf("%.2f",$data['intention_recorded'] - $data['intention_adjustment'] - $data['intention_refund']); //账上意向金
$data['custody_recorded'] = $this->sumPayLogPriceByType(30, 0, $where);//保管金入账 $data['custody_recorded'] = $this->sumPayLogPriceByType(30, 0, $where);//保管金入账
$agent_fee = $this->sumPayLogPriceByType(4, 1, $where);//保管金转中介费 $agent_fee = $this->sumPayLogPriceByType(4, 1, $where);//保管金转中介费
...@@ -4339,7 +4339,7 @@ class Finance extends Basic ...@@ -4339,7 +4339,7 @@ class Finance extends Basic
if (isset($params['create_time'])) { if (isset($params['create_time'])) {
$where['a.create_time'] = $params['create_time']; $where['a.create_time'] = $params['create_time'];
} }
$where['b.is_open'] = $is_open; $where['a.is_open'] = $is_open;
$where['a.type'] = $type; $where['a.type'] = $type;
$where['b.status'] = ['<>', '30']; $where['b.status'] = ['<>', '30'];
$where['b.father_id'] = $where['a.is_del'] = 0; $where['b.father_id'] = $where['a.is_del'] = 0;
...@@ -4368,10 +4368,9 @@ class Finance extends Basic ...@@ -4368,10 +4368,9 @@ class Finance extends Basic
} }
if ($is_bargain) { if ($is_bargain) {
$where['c.is_open'] = $is_open; $where['b.is_open'] = $is_open;
$where['a.type'] = $type; $where['a.type'] = $type;
$where['c.status'] = ['<>', '30']; $where['a.is_del'] = 0;
$where['c.father_id'] = $where['a.is_del'] = 0;
$where['a.status'] = ['<>', 4]; $where['a.status'] = ['<>', 4];
$price = $m_pay->sumBargainPrice('a.refund_money', $where); //未开业中介费 $price = $m_pay->sumBargainPrice('a.refund_money', $where); //未开业中介费
} else { } else {
......
...@@ -337,7 +337,6 @@ class ORefundModel extends Model{ ...@@ -337,7 +337,6 @@ class ORefundModel extends Model{
public function sumBargainPrice($field, $where) { public function sumBargainPrice($field, $where) {
return $this->db_->alias('a') return $this->db_->alias('a')
->join('o_paylog b','a.pay_log_id=b.id', 'left') ->join('o_paylog b','a.pay_log_id=b.id', 'left')
->join('o_bargain c','b.bargain_id=c.id', 'left')
->where($where) ->where($where)
->sum($field); ->sum($field);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment