Commit 302d549c authored by hujun's avatar hujun

代码调整

parent 3733c1bf
......@@ -23,7 +23,6 @@ class GHousesToAgents extends BaseModel
*/
public function addAgents($agents_id, $houses_id, $type, $operation_id)
{
$agent_push_str = '';
$agent_arr = [];
$agents_id = array_unique(explode(',', $agents_id));
$record_agents_id = [];
......@@ -43,7 +42,6 @@ class GHousesToAgents extends BaseModel
$agent_id_old[] = $v2;
$agent_push[] = $name;
$agent_push_str = '删除盘方:';
}
$records->record('', 2, '删除盘方' . implode(',', $name), $houses_id);
}
......@@ -52,14 +50,12 @@ class GHousesToAgents extends BaseModel
$houses_data = $this->where($where)->select();
$key = 0;
foreach ($houses_data as $k => $v) {
if (!in_array($v['agents_id'], $agents_id) && ($type == $v['type']) && ($v['agents_id'] != NULL)) {
//伪删除
$agent_arr[$key]['id'] = $v['id'];
$agent_arr[$key]['is_del'] = 1;
$key++;
}
}
foreach ($agents_id as $k => $v) {
......@@ -75,7 +71,7 @@ class GHousesToAgents extends BaseModel
$record_agents_id[] = $v;
}
if ($check || $v == 0) {
if ($check || empty($v)) {
continue;
}
......@@ -112,8 +108,6 @@ class GHousesToAgents extends BaseModel
$str = '新增为:';
$records->record('', 2, $str . implode(',', $name), $houses_id);
}
}
$res = $this->saveAll($agent_arr);
......@@ -128,16 +122,14 @@ class GHousesToAgents extends BaseModel
//更新业绩统计
$sum = new ResultsSummaryNewTask();
$sum->updateTotalByAgentId($agent_data['id'], $agent_data['store_id'], $agent_data['district_id'], $date); //被修改的人
$agent_push[] = $agent_data['name'];
$agent_push_str = '编辑:';
}
}
}
if (!empty($agent_id_old) && !empty($agent_push)) {
$push = new PushMessageService();
$this->push->record(1, [ 0 => $houses_id ], 0, $operation_id); //记录推送信息
$push->record(1, [ 0 => $houses_id ], 0, $operation_id); //记录推送信息
}
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