* [refac] use delete and insert operations instead of replace operation.
This commit is contained in:
@@ -53,8 +53,17 @@ class settingModel extends model
|
||||
$item = $this->parseItemPath($path);
|
||||
if(empty($item)) return false;
|
||||
|
||||
$vision = zget($item, 'vision', '');
|
||||
|
||||
$item->value = strval($value);
|
||||
$this->dao->replace(TABLE_CONFIG)->data($item)->exec();
|
||||
$this->dao->delete()->from(TABLE_CONFIG)
|
||||
->where('owner')->eq($item->owner)
|
||||
->andWhere('module')->eq($item->module)
|
||||
->andWhere('section')->eq($item->section)
|
||||
->andWhere('`key`')->eq($item->key)
|
||||
->beginIF($vision)->andWhere('vision')->eq($vision)->fi()
|
||||
->exec();
|
||||
$this->dao->insert(TABLE_CONFIG)->data($item)->exec();
|
||||
|
||||
return !dao::isError();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user