Example #1
0
        /// <summary>
        /// 平台审核提现申请记录
        /// </summary>
        /// <param name="ids"></param>
        /// <param name="state"></param>
        /// <param name="appId"></param>
        /// <param name="listDrawCashApply"></param>
        /// <param name="accountId"></param>
        /// <returns></returns>
        public string UpdatePlatDrawCashApply(string ids, int state, int aid, string accountId)
        {
            //1.更新提现申请.如果为标记为审核不通过则需要将提现金额归还并且标记为提现失败,如果标记为审核通过则不需要归还,然后将其标记为提现中2.记录操作日志  两个都成功才算成功
            TransactionModel     tranModel        = new TransactionModel();
            DrawCashApplyLog     drawCashApplyLog = new DrawCashApplyLog();
            List <DrawCashApply> list             = GetListByIds(aid, ids);

            if (list == null || list.Count <= 0)
            {
                return("无效申请记录");
            }
            if (string.IsNullOrEmpty(accountId))
            {
                return("无效用户");
            }
            if (state == -1)
            {
                //表示审核不通过  要标记为提现失败  并且需要把提现金额归还  最后记录操作日志
                //标记为审核不通过以及提现失败
                tranModel.Add($"update drawcashapply set state=-1,drawState=-1,updatetime='{DateTime.Now}' where Id in({ids}) and aid={aid}");
                //之前扣的佣金归还
                foreach (DrawCashApply item in list)
                {
                    PlatUserCash usercase = PlatUserCashBLL.SingleModel.GetModelByUserId(aid, item.userId);
                    usercase.UseCash += item.applyMoney;
                    tranModel.Add(PlatUserCashBLL.SingleModel.BuildUpdateSql(usercase, "UseCash"));
                }

                drawCashApplyLog.remark = $"将提现申请记录id为{ids}设置为审核不通过";
            }
            else
            {
                //表示审核通过
                drawCashApplyLog.remark = $"将提现申请记录id为{ids}设置为审核通过";
                //标记为审核通过以及提现中,只有这样提现服务才会获取去提现
                tranModel.Add($"update drawcashapply set state=1,drawState=1,updatetime='{DateTime.Now}' where Id in({ids}) and aid={aid}");
            }

            drawCashApplyLog.accountid = accountId;
            drawCashApplyLog.appId     = aid;
            drawCashApplyLog.AddTime   = DateTime.Now;
            drawCashApplyLog.hostIP    = Utility.WebHelper.GetIP();
            //记录操作日志
            tranModel.Add(DrawCashApplyLogBLL.SingleModel.BuildAddSql(drawCashApplyLog));

            bool success = DrawCashApplyLogBLL.SingleModel.ExecuteTransactionDataCorect(tranModel.sqlArray);

            return(success ? "" : "操作失败");
        }
Example #2
0
        /// <summary>
        /// 专业版分销后台审核提现申请记录 操作 为true表示操作成功
        /// </summary>
        /// <param name="ids"></param>
        /// <param name="state"></param>
        /// <param name="appId"></param>
        /// <param name="listDrawCashApply"></param>
        /// <param name="accountId"></param>
        /// <returns></returns>
        public bool UpdateDrawCashApply(string ids, int state, int appId, List <DrawCashApply> listDrawCashApply, string accountId)
        {
            //1.更新提现申请.如果为标记为审核不通过则需要将提现金额归还并且标记为提现失败,如果标记为审核通过则不需要归还,然后将其标记为提现中2.记录操作日志  两个都成功才算成功

            TransactionModel tranModel        = new TransactionModel();
            DrawCashApplyLog drawCashApplyLog = new DrawCashApplyLog();

            if (state == -1)
            {
                //表示审核不通过  要标记为提现失败  并且需要把提现金额归还  最后记录操作日志

                tranModel.Add($"update drawcashapply set state=-1,drawState=-1 where Id in({ids}) and aid={appId}");//标记为审核不通过以及提现失败

                //之前扣的佣金归还
                foreach (var item in listDrawCashApply)
                {
                    SalesMan salesMan = SalesManBLL.SingleModel.GetModel($"userId={item.userId} and appId={item.Aid}");
                    salesMan.useCash += item.cashMoney;
                    tranModel.Add(SalesManBLL.SingleModel.BuildUpdateSql(salesMan, "useCash"));
                }

                drawCashApplyLog.remark = $"将提现申请记录id为{ids}设置为审核不通过";
            }
            else
            {
                //表示审核通过
                drawCashApplyLog.remark = $"将提现申请记录id为{ids}设置为审核通过";
                tranModel.Add($"update drawcashapply set state=1,drawState=1 where Id in({ids}) and aid={appId}");//标记为审核通过以及提现中,只有这样提现服务才会获取去提现
            }


            drawCashApplyLog.accountid = accountId;
            drawCashApplyLog.appId     = appId;
            drawCashApplyLog.AddTime   = DateTime.Now;
            drawCashApplyLog.hostIP    = Utility.WebHelper.GetIP();
            //记录操作日志
            tranModel.Add(DrawCashApplyLogBLL.SingleModel.BuildAddSql(drawCashApplyLog));

            return(DrawCashApplyLogBLL.SingleModel.ExecuteTransactionDataCorect(tranModel.sqlArray));
        }