李昊 4 年之前
父節點
當前提交
d5bf35c020
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      gx_api/GxPress/Repository/GxPress.Repository.Implement/MiddleRepository.cs

+ 4 - 4
gx_api/GxPress/Repository/GxPress.Repository.Implement/MiddleRepository.cs

@@ -174,10 +174,10 @@ namespace GxPress.Repository.Implement
             var databaseType = _databaseTypeStr.ToEnum<DatabaseType>(DatabaseType.MySql);
             var database = new Database(databaseType, _connectionString);
             var connection = database.GetConnection();
-            //return await _repository.UpdateAsync(Q.Set(nameof(Middle.IsTop), !middle.IsTop).Where(nameof(Middle.Id), id)) > 0;
-            var isTop = middle.IsTop == true ? 0 : 1;
-            var sql = $"update tede_middle set IsTop={isTop} where id={id}";
-            return await connection.ExecuteAsync(sql) > 0;
+            return await _repository.UpdateAsync(Q.Set(nameof(Middle.IsTop), !middle.IsTop).Where(nameof(Middle.Id), id)) > 0;
+            // var isTop = middle.IsTop == true ? 0 : 1;
+            // var sql = $"update tede_middle set IsTop={isTop} where id={id}";
+            // return await connection.ExecuteAsync(sql) > 0;
         }
 
         public async Task<bool> DeleteAsync(NoticeDeRequest request)