From b4989426acba2e6b8aeda4d5b33d64d42737c6e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com> Date: Wed, 24 Apr 2024 09:50:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A1=AB=E5=86=99=E9=97=AE?= =?UTF-8?q?=E5=8D=B7=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Front/CustomerController.cs | 10 +++++++++- New_College.Model/Models/QuestionNaire.cs | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/New_College.Api/Controllers/Front/CustomerController.cs b/New_College.Api/Controllers/Front/CustomerController.cs index a616f2e..d3fbb53 100644 --- a/New_College.Api/Controllers/Front/CustomerController.cs +++ b/New_College.Api/Controllers/Front/CustomerController.cs @@ -4,6 +4,7 @@ using System.ComponentModel; using System.Linq; using System.Threading.Tasks; using Autofac.Core; +using Castle.Core.Resource; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -516,13 +517,20 @@ namespace New_College.Api.Controllers.Front { var count = await _naireRepository.Add(new QuestionNaire() { - Id = dto.id, + CustomerId = dto.id, CreateTime = DateTime.Now, infoList = dto.infoList, IsDelete = false, ModifyTime = DateTime.Now, OrderSort = 0 }); + if (count > 0) + { + var firstinfo = await _services.QueryById((object)dto.id); + firstinfo.IsVIP = true; + firstinfo.ModifyTime = DateTime.Now; + await _services.Update(firstinfo); + } return new MessageModel() { response = count > 0, diff --git a/New_College.Model/Models/QuestionNaire.cs b/New_College.Model/Models/QuestionNaire.cs index cb9a8ad..d5a2a00 100644 --- a/New_College.Model/Models/QuestionNaire.cs +++ b/New_College.Model/Models/QuestionNaire.cs @@ -20,6 +20,8 @@ namespace New_College.Model.Models [SugarColumn(IsNullable = false, IsPrimaryKey = true, IsIdentity = true)] public int Id { get; set; } + public int CustomerId { get; set; } + /// /// 学校名称 ///