Commit 214eefe8 authored by hujun's avatar hujun

批量修改盘方记录

parent ff76a8ad
......@@ -15,6 +15,7 @@ use app\model\AAgents;
use app\model\GHouses;
use app\model\GHousesImgs;
use app\model\GHousesToAgents;
use app\model\GOperatingRecords;
use app\model\SubletModel;
use think\Request;
......@@ -404,7 +405,7 @@ class Houses extends Basic
$agent->lock(true);
$where['type'] = 2;
$where['b.id'] = $this->params['old_agents_id'];
$agent_house = $agent->getHouseAgent('a.id', $where);
$agent_house = $agent->getHouseAgent('a.id,a.houses_id', $where);
$agent_data_arr = [];
......@@ -417,6 +418,15 @@ class Houses extends Basic
}
$total = $agent->updateUserAll($agent_data_arr);
$records = new GOperatingRecords();
$agent = new AAgents();
foreach ($agent_house as $k=>$v) {
$agent_data = $agent->getAgentInfo('name,phone', $this->params['agents_id']);
$remark = '批量修改客方为'.$agent_data['name'].'-'.$agent_data['phone'];
$records->record($this->userId, 2, $remark, $v['houses_id'], $v['id']);
}
$agent->commit();
return $this->response(200, '', [ 'total' => count($total) ]);
}
......
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