Commit 3c90daf9 authored by hujun's avatar hujun

客方统计

parent f110d334
......@@ -377,9 +377,15 @@ class Member extends Basic{
return $this->response(101, '该用户已经存在!');
}
$agent = new AAgents();
$agent_data = $agent->getAgentInfo('name,phone', $this->params['agents_id']);
$agent_data = $agent->getAgentInfo('id,name,phone,store_id,district_id', $this->params['agents_id']);
$remark = '新增为' . $agent_data['name'] . '-' . $agent_data['phone'];
$result = $this->user->edit($this->params, $this->params['id'], $this->userId); //新增或编辑
//更新业绩统计
$sum = new ResultsSummaryNewTask();
$date = date('Y-m-d');
$sum->updateTotalByAgentId($agent_data['id'], $agent_data['store_id'], $agent_data['district_id'], $date);
$this->operating_records($this->userId, $type=3, $remark, $this->params['id']); //记录日志
} else {
$user_data = $this->user->getUserById('id,agent_id', $this->params['id']);
......@@ -391,8 +397,13 @@ class Member extends Basic{
//是否修改客方
if ($this->params['agents_id'] != $user_data['agent_id']) {
$agent = new AAgents();
$agent_data = $agent->getAgentInfo('name,phone', $this->params['agents_id']);
$agent_data = $agent->getAgentInfo('id,name,phone,store_id,district_id', $this->params['agents_id']);
$remark = '修改为' . $agent_data['name'] . '-' . $agent_data['phone'];
//更新业绩统计
$sum = new ResultsSummaryNewTask();
$date = date('Y-m-d');
$sum->updateTotalByAgentId($agent_data['id'], $agent_data['store_id'], $agent_data['district_id'], $date);
} else {
$remark = '用户编辑';
}
......
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