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;
|
$oldCode = $model->code;
|
||||||
$model->name = $data["Name"];
|
$model->name = $data["Name"];
|
||||||
$model->code = $data["Code"];
|
$model->code = $data["Code"];
|
||||||
$model->pid = $data["Pid"] !== "" ? $data["Pid"] : 0;
|
if ($model->pid != 1) {
|
||||||
|
$model->pid = $data["Pid"] !== "" ? $data["Pid"] : 0;
|
||||||
|
}
|
||||||
$model->modified_at = time();
|
$model->modified_at = time();
|
||||||
if ($model->save()) {
|
if ($model->save()) {
|
||||||
Department::updateAll(["pid" => $data["Code"]], ["pid" => $oldCode]);
|
Department::updateAll(["pid" => $data["Code"]], ["pid" => $oldCode]);
|
||||||
|
|||||||
Reference in New Issue
Block a user