|
|
@@ -159,6 +159,11 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
159
|
159
|
if (string.IsNullOrEmpty(input.phone))
|
|
160
|
160
|
return Error("请输入联系方式");
|
|
161
|
161
|
|
|
|
162
|
+ if (await _cus_vip_infoRepository.GetCount(q => q.F_Phone == input.phone)>1)
|
|
|
163
|
+ {
|
|
|
164
|
+ return Error("手机号已存在");
|
|
|
165
|
+ }
|
|
|
166
|
+
|
|
162
|
167
|
var model = new T_Cus_VipInfo();
|
|
163
|
168
|
//model.F_VIPCode = input.vipcode;//会员卡号
|
|
164
|
169
|
model.F_Name = input.name;
|
|
|
@@ -225,11 +230,18 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Customer
|
|
225
|
230
|
[HttpPost("update")]
|
|
226
|
231
|
public async Task<IActionResult> UpdateAsync(VipInfoInput input)
|
|
227
|
232
|
{
|
|
|
233
|
+ if (input.id == 0)
|
|
|
234
|
+ return Error("请输入ID");
|
|
228
|
235
|
if (string.IsNullOrEmpty(input.name))
|
|
229
|
236
|
return Error("请输入名字");
|
|
230
|
237
|
if (string.IsNullOrEmpty(input.phone))
|
|
231
|
238
|
return Error("请输入联系方式");
|
|
232
|
239
|
|
|
|
240
|
+ if (await _cus_vip_infoRepository.GetCount(q => q.F_Phone == input.phone&&q.F_ID!= input.id) > 1)
|
|
|
241
|
+ {
|
|
|
242
|
+ return Error("手机号已存在");
|
|
|
243
|
+ }
|
|
|
244
|
+
|
|
233
|
245
|
var model = await _cus_vip_infoRepository.GetSingle(x => x.F_ID == input.id && x.F_State == (int)EnumDelState.Enabled);
|
|
234
|
246
|
if (model == null)
|
|
235
|
247
|
return Error("操作失败");
|