Fixed saving edit_by in some Controllers
This commit is contained in:
@@ -39,6 +39,16 @@ class Contract extends mfBaseModel {
|
||||
private $editor;
|
||||
|
||||
|
||||
protected function beforeUpdate($data) {
|
||||
if(!array_key_exists("edit_by", $data)) {
|
||||
$me = new User();
|
||||
$me->loadMe();
|
||||
$data["edit_by"] = $me->id;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function afterSave() {
|
||||
if($this->in_after_save) return true;
|
||||
$this->in_after_save++;
|
||||
|
||||
@@ -885,7 +885,6 @@ class ContractController extends mfBaseController {
|
||||
if ($mode == "add") {
|
||||
$contract = ContractModel::create($contract_data);
|
||||
} else {
|
||||
$contract->edit_by = $this->me->id;
|
||||
$contract->update($contract_data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user