mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 17:53:25 +08:00
【修复】修复当新增或者删除会员等级后,【签到设置】连续签到规则数据错误,累计签到设置保存无效的问题。
This commit is contained in:
@@ -33,11 +33,13 @@ namespace CoreCms.Net.IRepository
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<AdminUiCallBack> InsertAsync(List<CoreCmsContinuousCheckInRules> entity);
|
Task<AdminUiCallBack> InsertAsync(List<CoreCmsContinuousCheckInRules> entity);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取缓存的所有数据
|
/// 获取的所有数据及子集
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<CoreCmsContinuousCheckInRules>> GetCaChe();
|
Task<List<CoreCmsContinuousCheckInRules>> GetDataWidthChild();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,18 +25,6 @@ namespace CoreCms.Net.IRepository
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ICoreCmsCumulativeCheckInRulesRepository : IBaseRepository<CoreCmsCumulativeCheckInRules>
|
public interface ICoreCmsCumulativeCheckInRulesRepository : IBaseRepository<CoreCmsCumulativeCheckInRules>
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 重写异步更新方法
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="entity"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<AdminUiCallBack> InsertAsync(List<CoreCmsCumulativeCheckInRules> entity);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取缓存的所有数据
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<CoreCmsCumulativeCheckInRules>> GetCaChe();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,11 +32,13 @@ namespace CoreCms.Net.IServices
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<AdminUiCallBack> InsertAsync(List<CoreCmsContinuousCheckInRules> entity);
|
Task<AdminUiCallBack> InsertAsync(List<CoreCmsContinuousCheckInRules> entity);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取缓存的所有数据
|
/// 获取的所有数据及子集
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<CoreCmsContinuousCheckInRules>> GetCaChe();
|
Task<List<CoreCmsContinuousCheckInRules>> GetDataWidthChild();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,17 +24,5 @@ namespace CoreCms.Net.IServices
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ICoreCmsCumulativeCheckInRulesServices : IBaseServices<CoreCmsCumulativeCheckInRules>
|
public interface ICoreCmsCumulativeCheckInRulesServices : IBaseServices<CoreCmsCumulativeCheckInRules>
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 重写异步更新方法
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="entity"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<AdminUiCallBack> InsertAsync(List<CoreCmsCumulativeCheckInRules> entity);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取缓存的所有数据
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<CoreCmsCumulativeCheckInRules>> GetCaChe();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,13 +77,13 @@ namespace CoreCms.Net.Repository
|
|||||||
days = item.days
|
days = item.days
|
||||||
};
|
};
|
||||||
|
|
||||||
var id = await DbClient.Insertable(continuous).ExecuteReturnIdentityAsync();
|
var id = await DbClient.Insertable(continuous).RemoveDataCache().ExecuteReturnIdentityAsync();
|
||||||
if (id <= 0) continue;
|
if (id <= 0) continue;
|
||||||
foreach (var detail in item.details)
|
foreach (var detail in item.details)
|
||||||
{
|
{
|
||||||
detail.ruleId = id;
|
detail.ruleId = id;
|
||||||
}
|
}
|
||||||
await DbClient.Insertable(item.details).ExecuteReturnIdentityAsync();
|
await DbClient.Insertable(item.details).RemoveDataCache().ExecuteReturnIdentityAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
_unitOfWork.CommitTran();
|
_unitOfWork.CommitTran();
|
||||||
@@ -103,13 +103,12 @@ namespace CoreCms.Net.Repository
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#region 获取缓存的所有数据==========================================================
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取缓存的所有数据
|
/// 获取的所有数据及子集
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<CoreCmsContinuousCheckInRules>> GetCaChe()
|
public async Task<List<CoreCmsContinuousCheckInRules>> GetDataWidthChild()
|
||||||
{
|
{
|
||||||
var list = await DbClient.Queryable<CoreCmsContinuousCheckInRules>()
|
var list = await DbClient.Queryable<CoreCmsContinuousCheckInRules>()
|
||||||
.Select(p => new CoreCmsContinuousCheckInRules
|
.Select(p => new CoreCmsContinuousCheckInRules
|
||||||
@@ -123,53 +122,5 @@ namespace CoreCms.Net.Repository
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 重写根据条件查询分页数据
|
|
||||||
/// <summary>
|
|
||||||
/// 重写根据条件查询分页数据
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="predicate">判断集合</param>
|
|
||||||
/// <param name="orderByType">排序方式</param>
|
|
||||||
/// <param name="pageIndex">当前页面索引</param>
|
|
||||||
/// <param name="pageSize">分布大小</param>
|
|
||||||
/// <param name="orderByExpression"></param>
|
|
||||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<IPageList<CoreCmsContinuousCheckInRules>> QueryPageAsync(Expression<Func<CoreCmsContinuousCheckInRules, bool>> predicate,
|
|
||||||
Expression<Func<CoreCmsContinuousCheckInRules, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
|
||||||
int pageSize = 20, bool blUseNoLock = false)
|
|
||||||
{
|
|
||||||
RefAsync<int> totalCount = 0;
|
|
||||||
List<CoreCmsContinuousCheckInRules> page;
|
|
||||||
if (blUseNoLock)
|
|
||||||
{
|
|
||||||
page = await DbClient.Queryable<CoreCmsContinuousCheckInRules>()
|
|
||||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
|
||||||
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsContinuousCheckInRules
|
|
||||||
{
|
|
||||||
id = p.id,
|
|
||||||
days = p.days,
|
|
||||||
|
|
||||||
}).With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
page = await DbClient.Queryable<CoreCmsContinuousCheckInRules>()
|
|
||||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
|
||||||
.WhereIF(predicate != null, predicate).Select(p => new CoreCmsContinuousCheckInRules
|
|
||||||
{
|
|
||||||
id = p.id,
|
|
||||||
days = p.days,
|
|
||||||
|
|
||||||
}).ToPageListAsync(pageIndex, pageSize, totalCount);
|
|
||||||
}
|
|
||||||
var list = new PageList<CoreCmsContinuousCheckInRules>(page, pageIndex, pageSize, totalCount);
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,29 +34,5 @@ namespace CoreCms.Net.Repository
|
|||||||
_unitOfWork = unitOfWork;
|
_unitOfWork = unitOfWork;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 重写异步更新方法
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="entity"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<AdminUiCallBack> InsertAsync(List<CoreCmsCumulativeCheckInRules> entity)
|
|
||||||
{
|
|
||||||
var jm = new AdminUiCallBack();
|
|
||||||
|
|
||||||
var bl = await DbClient.Insertable(entity).ExecuteCommandAsync();
|
|
||||||
jm.code = 0;
|
|
||||||
jm.msg = GlobalConstVars.EditSuccess;
|
|
||||||
return jm;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取缓存的所有数据
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<List<CoreCmsCumulativeCheckInRules>> GetCaChe()
|
|
||||||
{
|
|
||||||
return await DbClient.Queryable<CoreCmsCumulativeCheckInRules>().With(SqlWith.NoLock).WithCache().ToListAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,14 +50,17 @@ namespace CoreCms.Net.Services
|
|||||||
return await _dal.InsertAsync(entity);
|
return await _dal.InsertAsync(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取缓存的所有数据
|
/// 获取的所有数据及子集
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<List<CoreCmsContinuousCheckInRules>> GetCaChe()
|
public async Task<List<CoreCmsContinuousCheckInRules>> GetDataWidthChild()
|
||||||
{
|
{
|
||||||
return await _dal.GetCaChe();
|
return await _dal.GetDataWidthChild();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,24 +39,5 @@ namespace CoreCms.Net.Services
|
|||||||
_unitOfWork = unitOfWork;
|
_unitOfWork = unitOfWork;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 重写异步插入方法
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="entity">实体数据</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<AdminUiCallBack> InsertAsync(List<CoreCmsCumulativeCheckInRules> entity)
|
|
||||||
{
|
|
||||||
return await _dal.InsertAsync(entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取缓存的所有数据
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public async Task<List<CoreCmsCumulativeCheckInRules>> GetCaChe()
|
|
||||||
{
|
|
||||||
return await _dal.GetCaChe();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ namespace CoreCms.Net.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
//判断累计签到次数是否满足
|
//判断累计签到次数是否满足
|
||||||
var cumulativeCheckInRules = await _cumulativeCheckInRulesServices.GetCaChe();
|
var cumulativeCheckInRules = await _cumulativeCheckInRulesServices.QueryAsync(true, true);
|
||||||
//获取用户总签到次数(使用userCheckIn的签到次数统计也可以,但是查询实时数据最可靠。根据个人来)
|
//获取用户总签到次数(使用userCheckIn的签到次数统计也可以,但是查询实时数据最可靠。根据个人来)
|
||||||
//var cumulativeCheckInCount = await _dal.GetCountAsync(p => p.userId == entity.userId);
|
//var cumulativeCheckInCount = await _dal.GetCountAsync(p => p.userId == entity.userId);
|
||||||
var cumulativeCheckInCount = userCheckIn.cumulativeCheckInCount;
|
var cumulativeCheckInCount = userCheckIn.cumulativeCheckInCount;
|
||||||
@@ -150,7 +150,7 @@ namespace CoreCms.Net.Services
|
|||||||
|
|
||||||
|
|
||||||
//判断连续签到次数是否满足
|
//判断连续签到次数是否满足
|
||||||
var continuousCheckInRules = await _continuousCheckInRulesServices.GetCaChe();
|
var continuousCheckInRules = await _continuousCheckInRulesServices.QueryAsync(true, true);
|
||||||
//获取用户数据
|
//获取用户数据
|
||||||
var user = await _userServices.QueryByIdAsync(entity.userId);
|
var user = await _userServices.QueryByIdAsync(entity.userId);
|
||||||
//获取用户当前已经连续签到的次数
|
//获取用户当前已经连续签到的次数
|
||||||
|
|||||||
@@ -1,16 +1,19 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Text.Json.Nodes;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using CoreCms.Net.Configuration;
|
using CoreCms.Net.Configuration;
|
||||||
using CoreCms.Net.Filter;
|
using CoreCms.Net.Filter;
|
||||||
using CoreCms.Net.IServices;
|
using CoreCms.Net.IServices;
|
||||||
using CoreCms.Net.Model.Entities;
|
using CoreCms.Net.Model.Entities;
|
||||||
using CoreCms.Net.Model.FromBody;
|
using CoreCms.Net.Model.FromBody;
|
||||||
|
using CoreCms.Net.Model.ViewModels.Basics;
|
||||||
using CoreCms.Net.Model.ViewModels.UI;
|
using CoreCms.Net.Model.ViewModels.UI;
|
||||||
using CoreCms.Net.Utility.Helper;
|
using CoreCms.Net.Utility.Helper;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
using SqlSugar;
|
using SqlSugar;
|
||||||
|
|
||||||
namespace CoreCms.Net.Web.Admin.Controllers.Shop
|
namespace CoreCms.Net.Web.Admin.Controllers.Shop
|
||||||
@@ -63,10 +66,38 @@ namespace CoreCms.Net.Web.Admin.Controllers.Shop
|
|||||||
var userGrade = await _coreCmsUserGradeServices.QueryAsync();
|
var userGrade = await _coreCmsUserGradeServices.QueryAsync();
|
||||||
|
|
||||||
//连续签到规则
|
//连续签到规则
|
||||||
var continuousCheckInRules = await _coreCmsContinuousCheckInRulesServices.GetCaChe();
|
var continuousCheckInRules = await _coreCmsContinuousCheckInRulesServices.GetDataWidthChild();
|
||||||
|
//制作新数据,防止出现
|
||||||
|
|
||||||
|
|
||||||
|
JArray newDetails = new JArray();
|
||||||
|
|
||||||
|
if (continuousCheckInRules.Any())
|
||||||
|
{
|
||||||
|
foreach (var item in continuousCheckInRules)
|
||||||
|
{
|
||||||
|
JArray di = new JArray();
|
||||||
|
var newUserGrand = userGrade;
|
||||||
|
foreach (var itemGrade in newUserGrand)
|
||||||
|
{
|
||||||
|
JObject diItem = new JObject();
|
||||||
|
diItem.Add("grand", JObject.FromObject(itemGrade));
|
||||||
|
var details = item.details.Find(p => p.userGradeId == itemGrade.id);
|
||||||
|
if (details != null)
|
||||||
|
{
|
||||||
|
diItem.Add("details", JObject.FromObject(details));
|
||||||
|
}
|
||||||
|
di.Add(diItem);
|
||||||
|
}
|
||||||
|
newDetails.Add(di);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//累计签到规则
|
//累计签到规则
|
||||||
var cumulativeCheckInRules = await _coreCmsCumulativeCheckInRulesServices.GetCaChe();
|
var cumulativeCheckInRules = await _coreCmsCumulativeCheckInRulesServices.QueryAsync(true, true);
|
||||||
|
|
||||||
jm.data = new
|
jm.data = new
|
||||||
{
|
{
|
||||||
@@ -74,6 +105,7 @@ namespace CoreCms.Net.Web.Admin.Controllers.Shop
|
|||||||
filesStorageOptionsType,
|
filesStorageOptionsType,
|
||||||
userGrade,
|
userGrade,
|
||||||
continuousCheckInRules,
|
continuousCheckInRules,
|
||||||
|
newDetails,
|
||||||
cumulativeCheckInRules
|
cumulativeCheckInRules
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -133,11 +165,12 @@ namespace CoreCms.Net.Web.Admin.Controllers.Shop
|
|||||||
}
|
}
|
||||||
|
|
||||||
//先清理掉数据,因为是配置数据,可直接删除添加新的
|
//先清理掉数据,因为是配置数据,可直接删除添加新的
|
||||||
var doEnpty = await _coreCmsCumulativeCheckInRulesServices.DeleteAsync(p => p.id > 0);
|
var doEnpty = await _coreCmsCumulativeCheckInRulesServices.DeleteAsync(p => p.id > 0, true);
|
||||||
|
|
||||||
//插入新的数据
|
//插入新的数据
|
||||||
|
var insertCount = await _coreCmsCumulativeCheckInRulesServices.InsertAsync(entity.entity, true);
|
||||||
|
|
||||||
|
|
||||||
var insertCount = await _coreCmsCumulativeCheckInRulesServices.InsertAsync(entity.entity);
|
|
||||||
jm.code = 0;
|
jm.code = 0;
|
||||||
jm.msg = "保存成功";
|
jm.msg = "保存成功";
|
||||||
return jm;
|
return jm;
|
||||||
|
|||||||
@@ -76,7 +76,6 @@
|
|||||||
<div class="layui-form-mid layui-word-aux">清除连续签到次数</div>
|
<div class="layui-form-mid layui-word-aux">清除连续签到次数</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<button class="layui-btn" lay-submit="" lay-filter="save">保存更改</button>
|
<button class="layui-btn" lay-submit="" lay-filter="save">保存更改</button>
|
||||||
@@ -103,24 +102,18 @@
|
|||||||
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
|
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
|
||||||
<legend>会员组设置</legend>
|
<legend>会员组设置</legend>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
{{# layui.each(item.details, function(indexChild, itemChild){ }}
|
{{# layui.each(d.data.newDetails[index], function(indexChild, itemChild){ }}
|
||||||
<div class="layui-form-item listItems">
|
<div class="layui-form-item listItems">
|
||||||
<input type="hidden" id="detailsId" name="continuousCheckInRules.details[{{index}}].id[{{indexChild}}]" value="{{itemChild.id}}">
|
<input type="hidden" id="detailsId" name="continuousCheckInRules.details[{{index}}].id[{{indexChild}}]" value="{{ itemChild.details ? itemChild.details.id : 0}}">
|
||||||
<input type="hidden" id="detailsUserGradeId" name="continuousCheckInRules.details[{{index}}].userGradeId[{{indexChild}}]" value="{{itemChild.userGradeId}}">
|
<input type="hidden" id="detailsUserGradeId" name="continuousCheckInRules.details[{{index}}].userGradeId[{{indexChild}}]" value="{{itemChild.grand.id}}">
|
||||||
<input type="hidden" id="detailsRuleId" name="continuousCheckInRules.details[{{index}}].ruleId[{{indexChild}}]" value="{{itemChild.ruleId}}">
|
<input type="hidden" id="detailsRuleId" name="continuousCheckInRules.details[{{index}}].ruleId[{{indexChild}}]" value="{{ item.id }}">
|
||||||
<label class="layui-form-label">
|
<label class="layui-form-label">{{ itemChild.grand.title }}</label>
|
||||||
{{# layui.each(d.data.userGrade, function(indexGrade, itemGrade){ }}
|
|
||||||
{{# if(itemChild.userGradeId === itemGrade.id){ }}
|
|
||||||
{{ itemGrade.title }}
|
|
||||||
{{# } }}
|
|
||||||
{{# }); }}
|
|
||||||
</label>
|
|
||||||
<div class="layui-input-inline layui-inline-2">
|
<div class="layui-input-inline layui-inline-2">
|
||||||
<input type="number" id="detailsNum" name="continuousCheckInRules.details[{{index}}].num[{{indexChild}}]" value="{{itemChild.num}}" lay-verify="required|number" autocomplete="off" placeholder="" class="layui-input">
|
<input type="number" id="detailsNum" name="continuousCheckInRules.details[{{index}}].num[{{indexChild}}]" value="{{itemChild.details ? itemChild.details.num : 0}}" lay-verify="required|number" autocomplete="off" placeholder="" class="layui-input">
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-input-inline layui-inline-4">
|
<div class="layui-input-inline layui-inline-4">
|
||||||
<input type="radio" id="detailsType" name="continuousCheckInRules.details[{{index}}].type[{{indexChild}}]" value="1" title="积分" {{itemChild.type==1?'checked="checked"':''}}>
|
<input type="radio" id="detailsType" name="continuousCheckInRules.details[{{index}}].type[{{indexChild}}]" value="1" title="积分" {{(itemChild.details && itemChild.details.type==1)|| !itemChild.details?'checked="checked"':''}}>
|
||||||
<input type="radio" id="detailsType" name="continuousCheckInRules.details[{{index}}].type[{{indexChild}}]" value="2" title="余额" {{itemChild.type==2?'checked="checked"':''}}>
|
<input type="radio" id="detailsType" name="continuousCheckInRules.details[{{index}}].type[{{indexChild}}]" value="2" title="余额" {{itemChild.details && itemChild.details.type==2?'checked="checked"':''}}>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{# }); }}
|
{{# }); }}
|
||||||
@@ -193,7 +186,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<script id="continuousCheckInBoxTmp" type="text/html">
|
<script id="continuousCheckInBoxTmp" type="text/html">
|
||||||
<div class="continuousCheckInBox coreshop-solid" data-id="{{d.index}}">
|
<div class="continuousCheckInBox coreshop-solid" data-id="{{d.index}}">
|
||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
@@ -264,6 +256,7 @@
|
|||||||
//开启调试情况下获取接口赋值数据
|
//开启调试情况下获取接口赋值数据
|
||||||
if (debug) { console.log(d); }
|
if (debug) { console.log(d); }
|
||||||
indexData = d.data;
|
indexData = d.data;
|
||||||
|
|
||||||
layui.use(['admin', 'form', 'coreHelper', 'element', 'table', 'util', 'laytpl', 'table', 'laydate'], function () {
|
layui.use(['admin', 'form', 'coreHelper', 'element', 'table', 'util', 'laytpl', 'table', 'laydate'], function () {
|
||||||
var $ = layui.$
|
var $ = layui.$
|
||||||
, setter = layui.setter
|
, setter = layui.setter
|
||||||
@@ -278,7 +271,6 @@
|
|||||||
, router = layui.router()
|
, router = layui.router()
|
||||||
, search = router.search;
|
, search = router.search;
|
||||||
|
|
||||||
|
|
||||||
//时间选择器
|
//时间选择器
|
||||||
laydate.render({
|
laydate.render({
|
||||||
elem: '#checkInAlertTime'
|
elem: '#checkInAlertTime'
|
||||||
@@ -304,7 +296,6 @@
|
|||||||
index: continuousCheckInRulesCount,
|
index: continuousCheckInRulesCount,
|
||||||
userGrade: d.data.userGrade
|
userGrade: d.data.userGrade
|
||||||
};
|
};
|
||||||
console.log(data);
|
|
||||||
var getTpl = continuousCheckInBoxTmp.innerHTML;
|
var getTpl = continuousCheckInBoxTmp.innerHTML;
|
||||||
laytpl(getTpl).render(data, function (html) {
|
laytpl(getTpl).render(data, function (html) {
|
||||||
$("#continuousCheckInRulesCount").before(html);
|
$("#continuousCheckInRulesCount").before(html);
|
||||||
@@ -326,7 +317,7 @@
|
|||||||
//重置排序
|
//重置排序
|
||||||
function resetContinuousCheckInRulesInputNameID() {
|
function resetContinuousCheckInRulesInputNameID() {
|
||||||
$.each($("#continuousCheckInBox .continuousCheckInBox"), function (i, item) {
|
$.each($("#continuousCheckInBox .continuousCheckInBox"), function (i, item) {
|
||||||
var oldIndex = $(this).attr('data-id');
|
//var oldIndex = $(this).attr('data-id');
|
||||||
$(this).attr('data-id', i);
|
$(this).attr('data-id', i);
|
||||||
$(this).find("#id").attr("name", "continuousCheckInRules.id[" + i + "]");
|
$(this).find("#id").attr("name", "continuousCheckInRules.id[" + i + "]");
|
||||||
$(this).find("#days").attr("name", "continuousCheckInRules.days[" + i + "]");
|
$(this).find("#days").attr("name", "continuousCheckInRules.days[" + i + "]");
|
||||||
@@ -510,7 +501,6 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
form.render();
|
form.render();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user