Commit 1884bd6d authored by hujun's avatar hujun

恢复成交报告统计

parent bdca07e4
...@@ -4601,26 +4601,26 @@ class Finance extends Basic ...@@ -4601,26 +4601,26 @@ class Finance extends Basic
if (empty($agent_arr)) { if (empty($agent_arr)) {
return $this->response($code, '没有该记录'); return $this->response($code, '没有该记录');
} }
foreach ($agent_arr as $k=>$v) {
try {
$this->totalOfficialReceipts($v['agent_id'], $v['district_id'], $v['store_id'], $v['create_time']);
$code = 200;
} catch (\Exception $e) {
$msg = '恢复失败:'.$e->getMessage();
break;
}
}
if ($code == 200) { $data['status'] = 10;
$data['status'] = 10; $data['audit_level'] = 0;
$data['audit_level'] = 0; $where_2[] = ['EXP', 'id ='.$this->params['id'].' OR father_id='.$this->params['id']];
$where_2[] = ['EXP', 'id ='.$this->params['id'].' OR father_id='.$this->params['id']]; $is_ok = $this->m_bargain->updateBargainByWhere($data, $where_2);
$is_ok = $this->m_bargain->updateBargainByWhere($data, $where_2); if ($is_ok) {
if (!$is_ok) { foreach ($agent_arr as $k=>$v) {
$code = 101; try {
$msg = '恢复成交报告状态失败'; $this->totalOfficialReceipts($v['agent_id'], $v['district_id'], $v['store_id'], $v['create_time']);
$code = 200;
} catch (\Exception $e) {
$msg = '恢复失败:'.$e->getMessage();
break;
}
} }
} else {
$code = 101;
$msg = '恢复成交报告状态失败';
} }
return $this->response($code, $msg); return $this->response($code, $msg);
} }
......
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