Commit b1e834e7 authored by hujun's avatar hujun

修改编辑店长

parent 4f3d412f
......@@ -97,15 +97,15 @@ class Store extends Basic
}
$district_id = $store->getStoreKeyById('district_id', ['id'=>$this->params['id']]);
$old_site_id = $m_district->getDistrictKeyById('site_id', ['id'=>$district_id]);
$new_site_id = $m_district->getDistrictKeyById('site_id', ['id'=>$this->params['district_id']]);
if (!empty($old_site_id)) {
$new_site_id = $m_district->getDistrictKeyById('site_id', ['id'=>$this->params['district_id']]);
if ($old_site_id != $new_site_id) {
return $this->response(101, '编辑门店部门,导致所属城市不一致');
if ($old_site_id != $new_site_id) {
return $this->response(101, '编辑门店部门,导致所属城市不一致');
}
$this->params['site_id'] = $new_site_id;
}
$this->params['site_id'] = $new_site_id;
}
$this->data = $store->addStoreAgents($this->params, $this->params['agents_id']);
......
......@@ -40,10 +40,10 @@ class AStore extends BaseModel
if ($data['id'] == '') {
$store_data['create_time'] = date('Y-m-d H:i:s');
$this->save($store_data);
$result = $this->id;
$result_id = $this->id;
} else {
$this->save($store_data, ['id'=>$data['id']]);
$result = $data['id'];
$result_id = $data['id'];
}
//处理经纪人等级 10业务员 20店长 30总监 40店长和总监
......@@ -63,6 +63,8 @@ class AStore extends BaseModel
} else {
$agents_data[$k]['level'] = 30;
}
$agents_data[$k]['store_id'] = $result_id;
}
}
$agents->saveAll($agents_data);
......@@ -73,10 +75,10 @@ class AStore extends BaseModel
} else {
$agents_store['level'] = 20;
}
$agents_store['store_id'] = $result;
$agents_store['store_id'] = $result_id;
$agents->editData($agents_store,$agents_id,'id');
return $result;
return $result_id;
}
/**
......
......@@ -271,6 +271,7 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
if(data.code==200){
alert('提交成功');
$("#modal-edit").modal('hide');
store.getList(store.pageNo);
}else{
alert(data.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