Commit 772254d4 authored by hujun's avatar hujun

agent_id

parent ab22631f
...@@ -2172,37 +2172,10 @@ class Finance extends Basic ...@@ -2172,37 +2172,10 @@ class Finance extends Basic
if (!empty($where)) { if (!empty($where)) {
//获取被修改人信息 //获取被修改人信息
$m_agent = new AAgents(); $m_agent = new AAgents();
$m_agent_total = new TAgentTotalModel();
$agent_data = $m_agent->agentBargainAll('a.id,a.store_id,a.district_id,b.create_time', $where); $agent_data = $m_agent->agentBargainAll('a.id,a.store_id,a.district_id,b.create_time', $where);
foreach ($agent_data as $k=>$v) { foreach ($agent_data as $k=>$v) {
$this->updatePerformanceData($v['id'], $v['create_time'], $v['store_id'],$v['district_id']); $create_time = date('Y-m-d', strtotime($v['create_time']));
$this->totalOfficialReceipts($v['id'], $v['district_id'], $v['store_id'], $create_time);
if ($is_select) {
$create_time = date('Y-m-d', strtotime($v['create_time']));
$where_bargain['agent_id'] = $v['id'];
$where_bargain['create_time'] = ['BETWEEN', [$create_time.' 00:00:00', $create_time.' 23:59:59']];
$bargainSum = $this->m_bargain->getAddBargainNumGroupTimeNew($where_bargain, 1);
$id = $m_agent_total->getTotalEndTimeByAgentId('id', ['total_time'=>$create_time, 'agent_id'=>$where_bargain['agent_id']]);
if (!empty($id)) {
$update_data[$k]["performance"] = !empty($bargainSum[0]["num"]) ? $bargainSum[0]["num"] : 0;
$update_data[$k]['id'] = $id[0]['id'];
}
if (empty($update_data)) {
$insert_data[] = [
'store_id' => $v['store_id'],
'district_id' => $v['district_id'],
'agent_id' => $v['agent_id'],
'total_time' => date('Y-m-d'),
'create_time' => date('Y-m-d H:i:s')
];
$m_agent_total->addTotal($insert_data);
} else {
$m_agent_total->saveTotal($update_data);
}
}
} }
} }
return true; return true;
...@@ -3012,7 +2985,7 @@ class Finance extends Basic ...@@ -3012,7 +2985,7 @@ class Finance extends Basic
//提交人姓名 //提交人姓名
if (!empty($this->params['agent_id'])) { if (!empty($this->params['agent_id'])) {
$where['d.agent_id'] = $this->params['agent_id']; $where['d.id'] = $this->params['agent_id'];
$is_show = 1; $is_show = 1;
} }
......
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