Compare commits
10 Commits
c9c8386da5
...
7c04ea046b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c04ea046b | ||
|
|
cb089e99e0 | ||
|
|
45c6bab5e6 | ||
|
|
5531880561 | ||
|
|
2f291d5f01 | ||
|
|
c9d10a03f1 | ||
|
|
adb68c9401 | ||
|
|
4b8fb4a684 | ||
|
|
6f370d5174 | ||
|
|
b55e8aa439 |
@@ -331,7 +331,7 @@
|
||||
break;
|
||||
case 3:
|
||||
this.l2tp = '1234';
|
||||
this.search_field = '极狐IP';
|
||||
this.search_field = '极光IP';
|
||||
this.sstp = '4430';
|
||||
break;
|
||||
case 2:
|
||||
|
||||
@@ -807,9 +807,9 @@
|
||||
<script src="/js/bootstrap-select.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
app.game();
|
||||
});
|
||||
// $(function () {
|
||||
// app.game();
|
||||
// });
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
@@ -1001,6 +1001,10 @@
|
||||
that.game_list = res.data;
|
||||
}
|
||||
});
|
||||
|
||||
this.$nextTick(() => {
|
||||
$('#gameselect').selectpicker('refresh'); // 重新渲染下拉框
|
||||
});
|
||||
this.select_game()
|
||||
},
|
||||
line() {
|
||||
@@ -1162,7 +1166,7 @@
|
||||
}
|
||||
}
|
||||
function onrecommend(id) {
|
||||
if (id != 29 && id != 3 && id != 28 && id != 22 && id != 21 && id != 20 && id != 18 && id != 1 ) {
|
||||
if (id != 29 && id != 26 && id != 3 && id != 28 && id != 22 && id != 21 && id != 20 && id != 18 && id != 1 ) {
|
||||
var lastClosedTime = localStorage.getItem('buyrecommend');
|
||||
if (!lastClosedTime) {
|
||||
// 如果之前没有关闭时间记录,则显示提示框
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
}
|
||||
}
|
||||
var id = getUrlParam('productId')
|
||||
if (id != 29 && id != 3 && id != 28 && id != 22 && id != 21 && id != 20 && id != 18 && id != 1 ) {
|
||||
if (id != 29 && id != 26 && id != 3 && id != 28 && id != 22 && id != 21 && id != 20 && id != 18 && id != 1 ) {
|
||||
var lastClosedTime = localStorage.getItem('buyrecommend');
|
||||
if (!lastClosedTime) {
|
||||
// 如果之前没有关闭时间记录,则显示提示框
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
success: function (res) {
|
||||
that.assign_add_list = res.data;
|
||||
that.assign_list =res.list;
|
||||
that.address_url = 'a.xgip.vip'
|
||||
that.address_url = 'a.xxxx'
|
||||
that.line_text = ''
|
||||
//if (res.Code == 10000) {
|
||||
// that.onLineData = res.Data;
|
||||
|
||||
@@ -1176,9 +1176,9 @@
|
||||
<script src="/js/bootstrap-select.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
app.game();
|
||||
});
|
||||
// $(function () {
|
||||
// app.game();
|
||||
// });
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
@@ -1372,6 +1372,9 @@
|
||||
that.game_list = res.data;
|
||||
}
|
||||
});
|
||||
this.$nextTick(() => {
|
||||
$('#gameselect').selectpicker('refresh'); // 重新渲染下拉框
|
||||
});
|
||||
this.select_game()
|
||||
},
|
||||
line() {
|
||||
@@ -1541,7 +1544,7 @@
|
||||
}
|
||||
function select(id) {
|
||||
|
||||
if (id != 3 && id != 29 && id != 28 && id != 22 && id != 21 && id != 20 && id != 18 && id != 1 ) {
|
||||
if (id != 3 && id != 26 && id != 29 && id != 28 && id != 22 && id != 21 && id != 20 && id != 18 && id != 1 ) {
|
||||
var lastClosedTime = localStorage.getItem('buyrecommend');
|
||||
if (!lastClosedTime) {
|
||||
// 如果之前没有关闭时间记录,则显示提示框
|
||||
|
||||
@@ -584,7 +584,7 @@
|
||||
}
|
||||
}
|
||||
var id = getUrlParam('productId')
|
||||
if (id != 29 && id != 3 && id != 28 && id != 22 && id != 21 && id != 20 && id != 18 && id != 1 ) {
|
||||
if (id != 29 && id != 26 && id != 3 && id != 28 && id != 22 && id != 21 && id != 20 && id != 18 && id != 1 ) {
|
||||
var lastClosedTime = localStorage.getItem('buyrecommend');
|
||||
if (!lastClosedTime) {
|
||||
// 如果之前没有关闭时间记录,则显示提示框
|
||||
|
||||
@@ -341,6 +341,136 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<h4>七、退款</h4>
|
||||
<h5>接口地址:/api/account/refund?apikey=1232455165&account=test1231</h5>
|
||||
<h5>请求方式:GET </h5>
|
||||
<table class="table table-bordered text-center" border="1">
|
||||
<caption>请求参数:</caption>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>apikey</td>
|
||||
<td>唯一key值</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>account</td>
|
||||
<td>账号</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-bordered text-center" border="1">
|
||||
<caption>返回数据:</caption>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Code</td>
|
||||
<td colspan="2">10000 成功/其他 失败</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Message</td>
|
||||
<td colspan="2">返回提示</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Data<br>返回信息</td>
|
||||
<td>成功:1; 失败:无返回</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<h4>八、查询账号是否存在</h4>
|
||||
<h5>接口地址:/api/account/acctExist?apikey=1232455165&account=test1231,123</h5>
|
||||
<h5>请求方式:GET </h5>
|
||||
<table class="table table-bordered text-center">
|
||||
<caption>请求参数:</caption>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>apikey</td>
|
||||
<td>唯一key值</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>account</td>
|
||||
<td>账号(单账户或多账户 多账户用英文 , 隔开)</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-bordered text-center">
|
||||
<caption>返回数据:</caption>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Code</td>
|
||||
<td colspan="2">10000 不存在/0 存在/其他 失败</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Message</td>
|
||||
<td colspan="2">返回提示</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="8">Data<br>返回信息 若存在(json)</td>
|
||||
<td>ProductName</td>
|
||||
<td>产品名称</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PackageName</td>
|
||||
<td>产品套餐</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Account</td>
|
||||
<td>账号</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ConnectCount</td>
|
||||
<td>连接数</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>StartTime</td>
|
||||
<td>开始时间</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>EndTime</td>
|
||||
<td>结束时间</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4>九、解除账号腾讯限制(仅限于<span style="font-weight: bold;">极狐、猎豹、极光、蘑菇</span>)</h4>
|
||||
<h5 style="color:red;">使用此权限请务必做好监管义务,如与用户签署或用户同意《网络信息安全承诺书》,上传手持身份证等措施,因您方监管不利导致的一切后果自负,使用此接口即视为默认同意此条款!</h5>
|
||||
<h5>接口地址:/api/account/openlimit?apikey=1232455165&account=test&productId=29</h5>
|
||||
<h5>请求方式:GET </h5>
|
||||
<table class="table table-bordered text-center">
|
||||
<caption>请求参数:</caption>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>apikey</td>
|
||||
<td>唯一key值</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>account</td>
|
||||
<td>账号</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>productId</td>
|
||||
<td>产品ID</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-bordered text-center">
|
||||
<caption>返回数据:</caption>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Code</td>
|
||||
<td colspan="2">10000 解除成功/其他 失败</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Message</td>
|
||||
<td colspan="2">返回提示</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
.editList {
|
||||
position: fixed;
|
||||
width: 400px;
|
||||
height: 240px;
|
||||
height: 260px;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
margin-left: -200px;
|
||||
@@ -104,9 +104,32 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.editList form, .zhanghaoCon form, .tab-content {
|
||||
width: 100%;
|
||||
}
|
||||
.editList form, .zhanghaoCon form, .tab-content {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#update_many_passwd {
|
||||
position: fixed;
|
||||
width: 400px;
|
||||
height: 260px;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
margin-left: -200px;
|
||||
margin-top: -120px;
|
||||
z-index: 3;
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 6px 8px 6px #ccc;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
padding: 30px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#update_many_passwd form, .zhanghaoCon form, .tab-content {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.activetit {
|
||||
border-bottom: 1px solid #3157ad !important;
|
||||
@@ -304,6 +327,21 @@
|
||||
<p class="text-center"><button type="button" class="btn btn-primary" v-on:click="UpdateAccountPwd">提交</button><button type="button" class="btn btn-danger quxiao" style="margin-left:20px;">取消</button></p>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="update_many_passwd">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label>账户:</label>
|
||||
<input type="text" class="form-control" placeholder="" id="update_many_account">
|
||||
<input type="hidden" class="form-control" placeholder="" id="update_many_proid">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>新密码:</label>
|
||||
<input type="text" class="form-control" placeholder="" id="update_many_pwd">
|
||||
</div>
|
||||
<p class="text-center"><button type="button" id="update_many_submit" class="btn btn-primary">提交</button><button type="button" class="btn btn-danger quxiao_update_many" style="margin-left:20px;">取消</button></p>
|
||||
</form>
|
||||
</div>
|
||||
<p class="wanshan"><img src="~/img/smile.png"> 为了给您带来更好的服务体验,请完善qq号和微信号。<a class="edit" asp-action="index" asp-controller="user" asp-route-e="1">立即完善》</a></p>
|
||||
<p style="text-align:center;">筛选功能已优化完成,可正常使用,更加便捷。</p>
|
||||
<div class="toolsBar">
|
||||
@@ -337,15 +375,7 @@
|
||||
<div class="btn-group">
|
||||
<select v-model="searchModel.PackageId" @@change="search" style="height:35px;">
|
||||
<option value="0">全部套餐</option>
|
||||
<option value="测试卡">测试卡</option>
|
||||
<option value="天卡">天卡</option>
|
||||
<option value="周卡">周卡</option>
|
||||
<option value="月卡">月卡</option>
|
||||
<option value="月卡(活动)">月卡(活动)</option>
|
||||
<option value="双月卡(活动)">双月卡(活动)</option>
|
||||
<option value="季卡">季卡</option>
|
||||
<option value="季卡(活动)">季卡(活动)</option>
|
||||
<option value="年卡">年卡</option>
|
||||
<option v-for="item in packages" v-if="item.Status == 1" :value="item.Name">{{item.Name}}</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
@@ -361,6 +391,7 @@
|
||||
<button type="button" class="btn btn-danger btn-rebuy"><img src="~/img/xufei.png"> 续费</button>
|
||||
<button type="button" class="btn btn-primary btn-refund">
|
||||
<img src="~/img/tui.png"> 退货</button>
|
||||
<button type="button" class="btn btn-warning btn-update-passwd">批量修改密码</button>
|
||||
<a style="color:red"> *批量续费可通过筛选和搜索功能精准定位账号</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -378,7 +409,8 @@
|
||||
<th>到期时间</th>
|
||||
<th>剩余时间</th>
|
||||
<th>在线及踢线</th>
|
||||
<th>选择地区</th>
|
||||
<!-- <th>选择地区</th> -->
|
||||
<th>操作</th>
|
||||
<th>软件下载</th>
|
||||
</tr>
|
||||
@foreach (var item in Model)
|
||||
@@ -400,8 +432,9 @@
|
||||
<td class="redT">@(item.Status==AccountStatus.Refund?"已退货": item.RestTime)</td>
|
||||
@*<td class="greenT">查看</td>*@
|
||||
<td class="blueT"><a @@click="online(@item.ProductId,'@item.Account')">查看</a> </td>
|
||||
<td class="blueT"><a v-if="@item.ProductId==19||@item.ProductId==13||@item.ProductId==17||@item.ProductId==1" @@click="assign_address(@item.ProductId,'@item.Account','@item.Pwd')">切换地区</a> </td>
|
||||
<!-- <td class="blueT"><a v-if="@item.ProductId==19||@item.ProductId==13||@item.ProductId==17||@item.ProductId==1" @@click="assign_address(@item.ProductId,'@item.Account','@item.Pwd')">切换地区</a> </td> -->
|
||||
|
||||
<td class="blueT" ><a v-on:click="deleteacct(@item.Id)">删除</a> </td>
|
||||
<td class="blueT"><a href="/product/soft">下载</a></td>
|
||||
</tr>
|
||||
} else {
|
||||
@@ -421,8 +454,9 @@
|
||||
<td class="redT">@(item.Status==AccountStatus.Refund?"已退货": item.RestTime)</td>
|
||||
@*<td class="greenT">查看</td>*@
|
||||
<td class="blueT"><a @@click="online(@item.ProductId,'@item.Account')">查看</a> </td>
|
||||
<td class="blueT"><a v-if="@item.ProductId==19||@item.ProductId==13||@item.ProductId==17||@item.ProductId==1" @@click="assign_address(@item.ProductId,'@item.Account','@item.Pwd')">切换地区</a> </td>
|
||||
<!-- <td class="blueT"><a v-if="@item.ProductId==19||@item.ProductId==13||@item.ProductId==17||@item.ProductId==1" @@click="assign_address(@item.ProductId,'@item.Account','@item.Pwd')">切换地区</a> </td> -->
|
||||
|
||||
<td class="blueT" ><a v-on:click="deleteacct('@item.Id')">删除</a></td>
|
||||
<td class="blueT"><a href="/product/soft">下载</a></td>
|
||||
</tr>
|
||||
}
|
||||
@@ -659,6 +693,31 @@
|
||||
}
|
||||
);
|
||||
},
|
||||
deleteacct(Id) {
|
||||
|
||||
let data = {
|
||||
cookie:document.cookie,
|
||||
id: Id
|
||||
}
|
||||
|
||||
if (confirm("您确定要删除该账号吗?")) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/manager/account/delete',
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
data: JSON.stringify(data),
|
||||
beforeSend: function(xhr) {
|
||||
xhr.withCredentials = true;
|
||||
},
|
||||
crossDomain: true,
|
||||
success: function (res) {
|
||||
alert('删除成功');
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
change_ip(account_id,package,account,old_ip){
|
||||
this.province_city = [];
|
||||
let data = {
|
||||
@@ -969,7 +1028,7 @@
|
||||
success: function (res) {
|
||||
that.assign_add_list = res.data;
|
||||
that.assign_list =res.list;
|
||||
that.address_url = 'a.xgip.vip'
|
||||
that.address_url = 'a.xxxx'
|
||||
//if (res.Code == 10000) {
|
||||
// that.onLineData = res.Data;
|
||||
// for (var i = 0; i < that.onLineData.length; i++) {
|
||||
@@ -1294,6 +1353,85 @@
|
||||
return true;
|
||||
}
|
||||
|
||||
$(".btn-update-passwd").on('click', function () {
|
||||
var accounts = [];
|
||||
var accountModels = [];
|
||||
var isrefund = false;
|
||||
var product_flag = false;
|
||||
|
||||
var product_id = 0;
|
||||
$.each($('input:checkbox:checked'), function () {
|
||||
var ppip = $(this).attr('a-pid');
|
||||
|
||||
product_id = ppip;
|
||||
|
||||
var account = $(this).val();
|
||||
if (account) {
|
||||
var accountItem = {
|
||||
account: account,
|
||||
pid: $(this).attr('a-pid')
|
||||
}
|
||||
accountModels.push(accountItem)
|
||||
accounts.push($(this).val())
|
||||
var status = $(this).attr('a-status');
|
||||
if (status == 'Refund') {
|
||||
isrefund = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (ppip != '3' && ppip != '29' && ppip != '18' && ppip != '26' && (typeof ppip != 'undefined')) {
|
||||
product_flag = true;
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
if (product_flag) {alert('仅支持极狐、蘑菇、极光、猎豹');return;}
|
||||
if (accountModels.length == 0) { alert('请选择账号'); return; }
|
||||
if (!isSame(accountModels, 'pid')) { alert('必须选择相同的产品'); return; }
|
||||
if (isrefund) { alert('退款账号暂不支持该操作'); return; }
|
||||
|
||||
$("#update_many_account").val(accounts.join(','));
|
||||
$("#update_many_proid").val(product_id);
|
||||
$("#update_many_passwd").show();
|
||||
|
||||
})
|
||||
|
||||
$(".quxiao_update_many").on('click', function () {
|
||||
$("#update_many_passwd").hide();
|
||||
})
|
||||
|
||||
$("#update_many_submit").on('click', function () {
|
||||
$("#update_many_passwd").hide();
|
||||
let data = {
|
||||
cookie:document.cookie,
|
||||
accounts:$("#update_many_account").val(),
|
||||
pwd:$("#update_many_pwd").val(),
|
||||
productId:$("#update_many_proid").val()
|
||||
}
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'https://php-api.juip.com/product/account/updatePasswd',
|
||||
dataType: "json",
|
||||
data:JSON.stringify(data),
|
||||
contentType: "application/json",
|
||||
success: function (res) {
|
||||
if(res.Code == 10000){
|
||||
alert('修改成功');
|
||||
window.location.reload();
|
||||
} else {
|
||||
alert('修改失败');
|
||||
}
|
||||
//if (res.Code == 10000) {
|
||||
// that.onLineData = res.Data;
|
||||
// for (var i = 0; i < that.onLineData.length; i++) {
|
||||
// that.onLineData[i].ProductId = productId;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
//续费
|
||||
$(".btn-rebuy").on('click', function () {
|
||||
var accounts = [];
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace Hncore.Pass.Vpn.Controllers
|
||||
{
|
||||
//通过apikey获取用户信息
|
||||
var userInfo = m_BaseUserService.Query(m => m.apikey == request.apikey).FirstOrDefault();
|
||||
return await m_ProductOrderService.Refund(userInfo.Id, request.Account);
|
||||
return await m_ProductOrderService.ApiRefund(userInfo.Id, request.Account);
|
||||
}
|
||||
|
||||
[UserAuth]
|
||||
|
||||
@@ -50,5 +50,6 @@ namespace Hncore.Pass.Vpn.Domain
|
||||
|
||||
public string Raw { get; set; }
|
||||
public int agent_id {get; set;}
|
||||
public int im {get; set;}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@ namespace Hncore.Pass.Vpn.Domain
|
||||
public int agent_id {get; set;}
|
||||
public string apikey {get; set;}
|
||||
public string id_code {get; set;}
|
||||
public int is_agent { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1139,6 +1139,8 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
}
|
||||
var accountInfo = await m_ProductAccountService.GetAccountInfo(account, userId);
|
||||
|
||||
var userEntity = await m_UserService.GetById(userId);
|
||||
|
||||
if (accountInfo == null)
|
||||
{
|
||||
return new ApiResult(ResultCode.C_Illegal_Operation, "账户不存在");
|
||||
@@ -1156,7 +1158,7 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
}
|
||||
var pacageInfo = await m_ProductPackageService.GetById(accountInfo.PackageId);
|
||||
|
||||
if (pacageInfo.DayCount == 1)
|
||||
if (pacageInfo.DayCount == 1 && userEntity.is_agent == 0)
|
||||
{
|
||||
return new ApiResult(ResultCode.C_Illegal_Operation, "天卡不能退款");
|
||||
}
|
||||
@@ -1168,7 +1170,6 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
|
||||
//折扣
|
||||
var refundDayPrice = 10.00M;
|
||||
var userEntity = await m_UserService.GetById(userId);
|
||||
if((userEntity.agent_id == 0||(userEntity.agent_id != 0 && userEntity.discount_id != 0)) && userEntity.discount_id >= 0){
|
||||
//获取代理折扣
|
||||
var discount = await m_ProductPriceSchemeService.GetById(userEntity.discount_id);
|
||||
@@ -1188,7 +1189,29 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
|
||||
var lastOrder = await GetLastOrderByAccount(account);
|
||||
|
||||
|
||||
var dateStr = lastOrder.StartTime.ToString();
|
||||
var now = DateTime.Now.GetUnixTimeStamp();
|
||||
|
||||
|
||||
|
||||
//解析字符串为 DateTime(假设是本地时间)
|
||||
DateTime dateTime = DateTime.Parse(dateStr);
|
||||
|
||||
// 转换为 UTC(如果原始时间是本地时间)
|
||||
DateTime utcTime = dateTime.ToUniversalTime();
|
||||
|
||||
// 计算 Unix 时间戳(秒)
|
||||
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
TimeSpan timeDiff = utcTime - epoch;
|
||||
long unixTimestampSeconds = (long)timeDiff.TotalSeconds + 3600;
|
||||
|
||||
var useDay = (int)Math.Ceiling((DateTime.Now - lastOrder.UpdateTime).TotalDays);
|
||||
|
||||
if (unixTimestampSeconds > now && userEntity.is_agent == 1) {
|
||||
useDay = 0;
|
||||
}
|
||||
|
||||
var refundAmount = lastOrder.PaymentAmount / lastOrder.AccountCount - useDay * refundDayPrice * accountInfo.ConnectCount;
|
||||
refundAmount = refundAmount <= 0 ? 0 : refundAmount;
|
||||
|
||||
@@ -1324,9 +1347,169 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ApiResult> ApiRefund(int userId, string account)
|
||||
{
|
||||
using (await _mutex1.LockAsync())
|
||||
{
|
||||
var reason = "";
|
||||
if(account.Contains("-")){
|
||||
string[] arrStr = account.Split('-');
|
||||
account = arrStr[0];
|
||||
reason = arrStr[1];
|
||||
}
|
||||
var accountInfo = await m_ProductAccountService.GetAccountInfo(account, userId);
|
||||
|
||||
if (accountInfo == null)
|
||||
{
|
||||
return new ApiResult(ResultCode.C_Illegal_Operation, "账户不存在");
|
||||
}
|
||||
if(accountInfo.ProductId == 20||accountInfo.ProductId == 21){
|
||||
return new ApiResult(ResultCode.C_Illegal_Operation, "无极账号不允许退款");
|
||||
}
|
||||
if (accountInfo.AccountType == (int)AccountType.Origin)
|
||||
{
|
||||
return new ApiResult(ResultCode.C_Illegal_Operation, "认证的账号不能退款");
|
||||
}
|
||||
if (accountInfo.EndTime < DateTime.Now)
|
||||
{
|
||||
return new ApiResult(ResultCode.C_Illegal_Operation, "已经过期");
|
||||
}
|
||||
var pacageInfo = await m_ProductPackageService.GetById(accountInfo.PackageId);
|
||||
|
||||
// if (pacageInfo.DayCount == 1)
|
||||
// {
|
||||
// return new ApiResult(ResultCode.C_Illegal_Operation, "天卡不能退款");
|
||||
// }
|
||||
if (pacageInfo.IsTest == 1)
|
||||
{
|
||||
return new ApiResult(ResultCode.C_Illegal_Operation, "测试卡不能退款");
|
||||
}
|
||||
var product = await this.m_ProductService.GetById(pacageInfo.ProductId);
|
||||
|
||||
//折扣
|
||||
var refundDayPrice = 10.00M;
|
||||
var userEntity = await m_UserService.GetById(userId);
|
||||
if((userEntity.agent_id == 0||(userEntity.agent_id != 0 && userEntity.discount_id != 0)) && userEntity.discount_id >= 0){
|
||||
//获取代理折扣
|
||||
var discount = await m_ProductPriceSchemeService.GetById(userEntity.discount_id);
|
||||
if (discount != null){
|
||||
refundDayPrice = (product.RefundDayPrice * discount.discount / 100).ToDecimal();
|
||||
} else {
|
||||
refundDayPrice = (product.RefundDayPrice).ToDecimal();
|
||||
}
|
||||
} else {
|
||||
var userPrice = await m_ProductUserPriceService.GetPackageUserPrice(pacageInfo.Id, userId);
|
||||
|
||||
refundDayPrice = (userPrice != null && userPrice.RefundDayPrice > 0 ? userPrice.RefundDayPrice : product.RefundDayPrice).ToDecimal();
|
||||
}
|
||||
|
||||
|
||||
var lastOrder = await GetLastOrderByAccount(account);
|
||||
|
||||
var dateStr = lastOrder.StartTime.ToString();
|
||||
var now = DateTime.Now.GetUnixTimeStamp();
|
||||
|
||||
|
||||
|
||||
//解析字符串为 DateTime(假设是本地时间)
|
||||
DateTime dateTime = DateTime.Parse(dateStr);
|
||||
|
||||
// 转换为 UTC(如果原始时间是本地时间)
|
||||
DateTime utcTime = dateTime.ToUniversalTime();
|
||||
|
||||
// 计算 Unix 时间戳(秒)
|
||||
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
TimeSpan timeDiff = utcTime - epoch;
|
||||
long unixTimestampSeconds = (long)timeDiff.TotalSeconds + 3600;
|
||||
|
||||
var useDay = (int)Math.Ceiling((DateTime.Now - lastOrder.UpdateTime).TotalDays);
|
||||
|
||||
if (unixTimestampSeconds > now) {
|
||||
useDay = 0;
|
||||
}
|
||||
|
||||
var refundAmount = lastOrder.PaymentAmount / lastOrder.AccountCount - useDay * refundDayPrice * accountInfo.ConnectCount;
|
||||
refundAmount = refundAmount <= 0 ? 0 : refundAmount;
|
||||
|
||||
//退款用户总消费修改 这个好像没用用处 已经有其他的统计地方
|
||||
userEntity.ConsumeAmount -= refundAmount;
|
||||
await m_UserService.Update(userEntity);
|
||||
|
||||
var order = new ProductOrderEntity()
|
||||
{
|
||||
AccountCount = 1,
|
||||
ConnectCount = accountInfo.ConnectCount,
|
||||
OrderName = accountInfo.ProductName,
|
||||
OrderNo = GeneratOrderNO(userId, OrderType.Refund),
|
||||
OrderState = OrderStatus.RequestRefund,
|
||||
OrderType = OrderType.Refund,
|
||||
PackageId = accountInfo.PackageId.Value,
|
||||
PackageName = accountInfo.PackageName,
|
||||
ProductId = accountInfo.ProductId.Value,
|
||||
ProductName = accountInfo.ProductName,
|
||||
PayType = PayType.None,
|
||||
UserId = userId,
|
||||
UserName = accountInfo.UserCode,
|
||||
DayCount = (accountInfo.EndTime - DateTime.Now).Value.Days,
|
||||
DayPrice = refundDayPrice,
|
||||
Accounts = account,
|
||||
PaymentAmount = lastOrder.PaymentAmount/ lastOrder.AccountCount,
|
||||
RefundAmount = refundAmount,
|
||||
RefundCount = 1,
|
||||
Remark = "API退款",
|
||||
RefundReason = reason,
|
||||
agent_id = accountInfo.agent_id
|
||||
};
|
||||
var time = (accountInfo.EndTime - DateTime.Now).Value;
|
||||
order.RefundRestTime = time.ToString(@"d\天hh\时mm\分");
|
||||
|
||||
//短信内容 部分运营商收不到短信
|
||||
var tpl_info = new Dictionary<string, string>(){
|
||||
{"product",accountInfo.ProductName},
|
||||
{"package",accountInfo.PackageName },
|
||||
{"connect",accountInfo.ConnectCount.ToString() },
|
||||
{"account",account },
|
||||
{"resttime",order.RefundRestTime},
|
||||
};
|
||||
|
||||
var againBuy = lastOrder.OrderType == OrderType.AgainBuy || lastOrder.OrderType == OrderType.AgainBuys;
|
||||
|
||||
var laoyingXunFei = againBuy && lastOrder.ProductId == 4;
|
||||
if (product.AutoRefund == 1 && !laoyingXunFei)
|
||||
{
|
||||
var refundRet = await this.m_AgentService.Refund(pacageInfo, accountInfo);
|
||||
if (refundRet.Code == ResultCode.C_SUCCESS)
|
||||
{
|
||||
order.OrderState = OrderStatus.AutoRefundOver;
|
||||
}
|
||||
}
|
||||
var amountInfo = new BaseInfo.Request.User.UpdateAmountRequest()
|
||||
{
|
||||
Amount = order.RefundAmount,
|
||||
OpAmountType = ScoreType.AccountRefund,
|
||||
UserId = order.UserId,
|
||||
AttchInfo = order.OrderNo,
|
||||
OperateUserName = accountInfo.UserCode
|
||||
};
|
||||
var retAmount = await m_BaseUserService.UpdateAmount(amountInfo);
|
||||
accountInfo.EndTime = DateTime.Now;
|
||||
accountInfo.Status = AccountStatus.Refund;
|
||||
await m_ProductAccountService.Update(accountInfo);
|
||||
await this.Add(order);
|
||||
|
||||
var managerEntity = await m_ManageService.GetById(userEntity.ManagerId.ToInt());
|
||||
if (managerEntity.TenantId == 1 && managerEntity.RoleId == 100 && DateTime.Now.Hour<23 && DateTime.Now.Hour>8) {
|
||||
AliSmsService.Send("SMS_462300235", new { name = userEntity.ManagerName,phone=userEntity.Phone }, "河南华连网络科技", managerEntity.Phone);
|
||||
}
|
||||
return new ApiResult(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public async Task<ApiResult> CaclRefund(int userId, string account)
|
||||
{
|
||||
var accountInfo = await m_ProductAccountService.GetAccountInfo(account, userId);
|
||||
var userEntity = await m_UserService.GetById(userId);
|
||||
|
||||
if(accountInfo.Status == AccountStatus.Refund){
|
||||
return new ApiResult(ResultCode.C_Illegal_Operation, "此类帐号不允许退款");
|
||||
@@ -1348,7 +1531,7 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
}
|
||||
var pacageInfo = await m_ProductPackageService.GetById(accountInfo.PackageId);
|
||||
|
||||
if (pacageInfo.DayCount == 1)
|
||||
if (pacageInfo.DayCount == 1 && userEntity.is_agent == 0)
|
||||
{
|
||||
return new ApiResult(ResultCode.C_Illegal_Operation, "天卡不能退款");
|
||||
}
|
||||
@@ -1358,7 +1541,6 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
|
||||
//折扣
|
||||
var refundDayPrice = 10.00M;
|
||||
var userEntity = await m_UserService.GetById(userId);
|
||||
if((userEntity.agent_id == 0||(userEntity.agent_id != 0 && userEntity.discount_id != 0)) && userEntity.discount_id >= 0){
|
||||
//获取代理折扣
|
||||
var discount = await m_ProductPriceSchemeService.GetById(userEntity.discount_id);
|
||||
@@ -1374,7 +1556,30 @@ FROM product_order where {where} GROUP BY Channel,ProductName order by Channel,
|
||||
}
|
||||
|
||||
var lastOrder = await GetLastOrderByAccount(account);
|
||||
var useDay = (int)Math.Ceiling((DateTime.Now - lastOrder.UpdateTime).TotalDays);
|
||||
|
||||
|
||||
var dateStr = lastOrder.StartTime.ToString();
|
||||
var now = DateTime.Now.GetUnixTimeStamp();
|
||||
|
||||
|
||||
|
||||
//解析字符串为 DateTime(假设是本地时间)
|
||||
DateTime dateTime = DateTime.Parse(dateStr);
|
||||
|
||||
// 转换为 UTC(如果原始时间是本地时间)
|
||||
DateTime utcTime = dateTime.ToUniversalTime();
|
||||
|
||||
// 计算 Unix 时间戳(秒)
|
||||
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
TimeSpan timeDiff = utcTime - epoch;
|
||||
long unixTimestampSeconds = (long)timeDiff.TotalSeconds + 3600;
|
||||
|
||||
var useDay = (int)Math.Ceiling((DateTime.Now - lastOrder.UpdateTime).TotalDays);
|
||||
|
||||
if (unixTimestampSeconds > now && userEntity.is_agent == 1) {
|
||||
useDay = 0;
|
||||
}
|
||||
|
||||
var RefundAmount = lastOrder.PaymentAmount / lastOrder.AccountCount - useDay * refundDayPrice * accountInfo.ConnectCount;
|
||||
RefundAmount = RefundAmount <= 0 ? 0 : RefundAmount;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user