Commit 12b3e817 authored by hujun's avatar hujun

部门编辑

parent 181131f7
...@@ -21,13 +21,21 @@ class ADistrict extends BaseModel ...@@ -21,13 +21,21 @@ class ADistrict extends BaseModel
*/ */
public function addDepartmentAgents($data, $agents_id) { public function addDepartmentAgents($data, $agents_id) {
$this->startTrans(); $this->startTrans();
$date = date('Y-m-d H:i:s');
$this->save([
'district_name' => $data['department_name'],
'create_time' => $date
]);
if ($this->id) { if (empty($data['id'])) {
$this->save([
'district_name' => $data['department_name'],
'create_time' => date('Y-m-d H:i:s')
]);
$id = $this->id;
} else {
$this->save([
'district_name' => $data['department_name'],
],['id'=>$data['id']]);
$id = $data['id'];
}
if ($id) {
$agents = new AAgents(); $agents = new AAgents();
$agents_data['district_id'] = $this->id; $agents_data['district_id'] = $this->id;
$agents_data['level'] = 30; $agents_data['level'] = 30;
......
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