Commit 8ea42836 authored by zw's avatar zw

Merge remote-tracking branch 'origin/1210-v3.0.2' into 1210-v3.0.2

parents 527ed7a0 a946d8d0
......@@ -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'])) {
......@@ -3320,4 +3322,33 @@ class Finance extends Basic
}
return empty($price) ? '' : $price;
}
/**
* 删除收款
*
* @return \think\Response
*/
public function delPayLog() {
$code = 101;
$msg = '';
if (empty($this->params['pay_id'])) {
return $this->response($code, '参数错误');
}
$m_pay_adjustment = new OPayLogAdjustment();
$pay_id = $m_pay_adjustment->getFieldValue('id', ['paylog_id'=>$this->params['pay_id']]);
if ($pay_id) {
return $this->response($code, '该收款有调整信息,不能删除');
}
$m_pay = new OPayLogModel();
$num = $m_pay->updatePayLog(['is_del'=>1, 'id'=>$this->params['pay_id']]);
if ($num > 0) {
$code = 200;
} else {
$code = 101;
$msg = '删除失败';
}
return $this->response($code, $msg);
}
}
......@@ -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,28 +353,12 @@ 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")
->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")
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();
}
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);
......
......@@ -281,6 +281,7 @@ Route::group('index', [
'delAdjustment' => ['index/Finance/delAdjustment', ['method' => 'post']],//撤销调整
'getAdjustmentDetail' => ['index/Finance/getAdjustmentDetail', ['method' => 'get']],//调整详情
'getPayLogTotalPrice' => ['index/Finance/getPayLogTotalPrice', ['method' => 'get']],//佣金统计
'delPayLog' => ['index/Finance/delPayLog', ['method' => 'POST']],//删除收款
'performanceInfo' => ['index/PerformanceInfo/performanceInfo', ['method' => 'post|get']],//业绩明细
'getPerformanceInfoExcel' => ['index/PerformanceInfo/getPerformanceInfoExcel', ['method' => 'post|get']],//业绩明细
......
......@@ -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