Skip to content

Commit

Permalink
Merge pull request #1 from liushuai/bug-removefailed
Browse files Browse the repository at this point in the history
修改removeSetting 方法 删除seting失败
  • Loading branch information
forecho authored Jan 18, 2021
2 parents 958c4ce + 76bdaf2 commit 5fe4de0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/models/TargetSettingModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function setSetting($key, $value, $targetType = '', $targetId = 0, $descr
public function removeSetting($key, $targetType = '', $targetId = 0)
{
$conditions = ['target_type' => $targetType, 'target_id' => $targetId, 'key' => $key];
if (!$model = static::find()->where($conditions)->limit(1)->one()) {
if ($model = static::find()->where($conditions)->limit(1)->one()) {
return $model->delete();
}
return false;
Expand Down

0 comments on commit 5fe4de0

Please sign in to comment.