Commit 652a07e5 authored by hujun's avatar hujun

总额

parent 797efb45
......@@ -2436,8 +2436,9 @@ class Finance extends Basic
if ($v['type'] == 92) {
//案场费 对应业务员:盘方
$current_agent_name = $m_agent_house->getHousesAgents($v['house_id'], 'b.name,b.store_id', ['a.type'=>2]);
$list[$k]['current_agent_name'] = $current_agent_name['name'];
$list[$k]['store_name'] = $m_store->getStoreKeyById('store_name', ['id'=>$current_agent_name['store_id']]);
$list[$k]['current_agent_name'] = empty($current_agent_name['name']) ? '':$current_agent_name['name'];
$store_name = $m_store->getStoreKeyById('store_name', ['id'=>$current_agent_name['store_id']]);
$list[$k]['store_name'] = empty($store_name)? '' : $store_name;
}
if ($v['type'] == 10 || $v['type'] == 30 || $v['type'] == 91) {
......@@ -2445,9 +2446,10 @@ class Finance extends Basic
//中介费 对应业务员:约带看的人 即 反签方
$current_agent_name = $m_march->getInfo('reception_name,reception_id', ['order_id'=>$v['order_id']]);
if (!empty($current_agent_name['reception_id'])) {
$list[$k]['store_name'] = $m_agent->getAgentByIdV2('b.store_name', ['a.id'=>$current_agent_name['reception_id']]);
$store_name = $m_agent->getAgentByIdV2('b.store_name', ['a.id'=>$current_agent_name['reception_id']]);
$list[$k]['store_name'] = empty($store_name)? '' : $store_name;
}
$list[$k]['current_agent_name'] = empty($current_agent_name['reception_name']) ? "" : $current_agent_name['reception_name'];
$list[$k]['current_agent_name'] = empty($current_agent_name['reception_name']) ? '' : $current_agent_name['reception_name'];
}
if (!empty($v['income_time'])) {
......
......@@ -332,40 +332,16 @@ class OPayLogModel extends Model
public function getAddPayLogOrderListLimit($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '')
{
$params["a.is_del"] = 0;
if (isset($params['e.name']) || isset($params['f.store_name']) || isset($params['e.phone'])) {
$data = Db::table($this->table)
->field($field)
->alias("a")
->join("o_order b", "a.order_id = b.id", "left")
// ->join("o_report c", "b.f_id = c.id", "left")
->join('g_houses d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'a.agent_id=e.id', 'left')
// ->join('a_store f', 'e.store_id=f.id', 'left')
// ->join('a_district g', 'f.district_id=g.id', 'left')
->limit($pageSize)
->page($pageNo)
->order($order_)
->where($params)
->select();
} else {
$data = Db::table($this->table)
->field($field)
return $this->db_->field($field)
->alias("a")
->join("o_order b", "a.order_id = b.id", "left")
// ->join("o_report c", "b.f_id = c.id", "left")
->join('g_houses d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'a.agent_id=e.id', 'left')
// ->join('a_store f', 'e.store_id=f.id', 'left')
// ->join('a_district g', 'f.district_id=g.id', 'left')
->limit($pageSize)
->page($pageNo)
->order($order_)
->where($params)
->select();
}
return $data;
}
/**
......@@ -377,29 +353,13 @@ class OPayLogModel extends Model
public function getAddPayLogOrderListLimitTotal($params = '')
{
$params["a.is_del"] = 0;
if (isset($params['e.name']) || isset($params['f.store_name']) || isset($params['e.phone'])) {
$data = Db::table($this->table)->alias("a")
return $this->db_->alias("a")
->join("o_order b", "a.order_id = b.id", "left")
// ->join("o_report c", "b.f_id = c.id", "left")
->join('g_houses d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'a.agent_id=e.id', 'left')
// ->join('a_store f', 'e.store_id=f.id', 'left')
// ->join('a_district g', 'f.district_id=g.id', 'left')
->where($params)
->count();
} else {
$data = Db::table($this->table)->alias("a")
->join("o_order b", "a.order_id = b.id", "left")
// ->join("o_report c", "b.f_id = c.id", "left")
->join('g_houses d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'a.agent_id=e.id', 'left')
// ->join('a_store f', 'e.store_id=f.id', 'left')
// ->join('a_district g', 'f.district_id=g.id', 'left')
->where($params)
->count();
}
return $data;
}
/**
* 订单总额
......@@ -416,22 +376,16 @@ class OPayLogModel extends Model
$data = Db::table($this->table)
->alias("a")
->join("o_order b", "a.order_id = b.id", "left")
// ->join("o_report c", "b.f_id = c.id", "left")
->join('g_houses d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'c.report_agent_id=e.id', 'left')
// ->join('a_store f', 'e.store_id=f.id', 'left')
// ->join('a_district g', 'f.district_id=g.id', 'left')
->join('a_agents e', 'a.agent_id=e.id', 'left')
->where($where)
->sum($field);
} else {
$data = Db::table($this->table)
->alias("a")
->join("o_order b", "a.order_id = b.id", "left")
// ->join("o_report c", "b.f_id = c.id", "left")
->join('g_houses d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'c.report_agent_id=e.id', 'left')
// ->join('a_store f', 'e.store_id=f.id', 'left')
// ->join('a_district g', 'f.district_id=g.id', 'left')
->join('a_agents e', 'a.agent_id=e.id', 'left')
->where($where)
->sum($field);
......
......@@ -571,7 +571,7 @@ define(['doT', 'text!temp/receivables_template_tpl.html', 'css!style/home.css',
that.listData = data.data.list;
var doTtmpl = doT.template(document.getElementById('receivables_template_tpl').innerHTML);
$("#order_list").html(doTtmpl(data.data.list));
// $("#money_total").html(data.data.money_total)
$("#money_total").html(data.data.money_total)
/*分页代码*/
add_page(data.data.total, no, that.pageSize, that.getList);
......
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