Commit c1c47869 authored by hujun's avatar hujun

同名提示

parent b4928cdc
......@@ -43,12 +43,22 @@ class BrokerService
*/
public function saveAgentData(array $data, int $operation_id)
{
$result['status'] = 'fail';
$is_new_id = 1;
$validate = new AAgentValidate();
$m_district = new ADistrict();
$data['site_id'] = $m_district->getDistrictKeyById('site_id', ['id' => $data['district_id']]);
$select_where['name'] = $data['name'];
$select_where['site_id'] = $data['site_id'];
$select_where['phone'] = ['<>', $data['phone']];
$check_id = $this->m_agent->getAgentsByWhere($select_where, 'id');
$result['status'] = 'fail';
if ($check_id) {
$result['msg'] = '同一城市出现同名,请修改。';
return $result;
}
if (empty($data['id'])) {
$check = $validate->scene('add')->check($data);
} else {
......
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