fix bug cây thư mục phòng ban
This commit is contained in:
@@ -89,7 +89,9 @@ class DepartmentController extends Controller {
|
||||
$oldCode = $model->code;
|
||||
$model->name = $data["Name"];
|
||||
$model->code = $data["Code"];
|
||||
if ($model->pid != 1) {
|
||||
$model->pid = $data["Pid"] !== "" ? $data["Pid"] : 0;
|
||||
}
|
||||
$model->modified_at = time();
|
||||
if ($model->save()) {
|
||||
Department::updateAll(["pid" => $data["Code"]], ["pid" => $oldCode]);
|
||||
|
||||
Reference in New Issue
Block a user