Commit 133d1455 authored by hujun's avatar hujun

新增盘方业绩统计

parent 3c90daf9
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace app\model; namespace app\model;
use app\task\controller\ResultsSummaryNewTask;
use Think\Db; use Think\Db;
...@@ -92,6 +93,7 @@ class GHousesToAgents extends BaseModel ...@@ -92,6 +93,7 @@ class GHousesToAgents extends BaseModel
continue; continue;
} }
$name[] = $agents->where('id', $v2)->value('name'); $name[] = $agents->where('id', $v2)->value('name');
$agent_id[] = $v2;
} }
$num = $this->where('houses_id', $houses_id)->count(); $num = $this->where('houses_id', $houses_id)->count();
...@@ -110,6 +112,19 @@ class GHousesToAgents extends BaseModel ...@@ -110,6 +112,19 @@ class GHousesToAgents extends BaseModel
} }
$res = $this->saveAll($agent_arr); $res = $this->saveAll($agent_arr);
if ($type==2 && count($agent_id) > 0) {
$date = date('Y-m-d');
foreach ($agent_id as $k=>$v) {
//获取被修改人信息
$m_agent = new AAgents();
$agent_data = $m_agent->agentBragainDetail('a.id,a.store_id,a.district_id,b.create_time', ['a.id'=>$v]);
//更新业绩统计
$sum = new ResultsSummaryNewTask();
$sum->updateTotalByAgentId($agent_data['id'], $agent_data['store_id'], $agent_data['district_id'], $date); //被修改的人
}
}
} }
return $res; return $res;
......
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