瀏覽代碼

fix(config): 修复推荐配置中的消费值处理问题

- 添加了对非数字或零值消费参数的检查
- 将无效的消费值设置为null以避免数据错误
- 确保更新操作前消费字段的有效性验证
shichen 5 月之前
父節點
當前提交
48ab0c4b29
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      app/common/repositories/shared/SharedProsperityRecommendConfigRepository.php

+ 6 - 0
app/common/repositories/shared/SharedProsperityRecommendConfigRepository.php

@@ -68,6 +68,12 @@ class SharedProsperityRecommendConfigRepository extends BaseRepository
68 68
     {
69 69
         $id = $params['id'];
70 70
         unset($params['id']);
71
+
72
+
73
+        if (!is_numeric($params['consume']) || $params['consume'] == 0) {
74
+            $params['consume'] = null;
75
+        }
76
+
71 77
         if (!$this->dao->update($id, $params)) {
72 78
             return false;
73 79
         }