diff --git a/src/app/admin/user/user-gold/user-gold.component.html b/src/app/admin/user/user-gold/user-gold.component.html
index c3b4a32..44c0e24 100644
--- a/src/app/admin/user/user-gold/user-gold.component.html
+++ b/src/app/admin/user/user-gold/user-gold.component.html
@@ -4,24 +4,14 @@
-
-
- ¥ 300
+
+
+ ¥ {{income}}
-
-
- ¥ 9000
-
-
-
-
- ¥ 200
-
-
-
-
- ¥ 2000
+
+
+ ¥ {{expend}}
@@ -53,6 +43,17 @@
+
+
+ 时间区间
+
+
+
+
+
diff --git a/src/app/admin/user/user-gold/user-gold.component.ts b/src/app/admin/user/user-gold/user-gold.component.ts
index 85323ba..fe1eb18 100644
--- a/src/app/admin/user/user-gold/user-gold.component.ts
+++ b/src/app/admin/user/user-gold/user-gold.component.ts
@@ -19,6 +19,8 @@ export class UserGoldComponent implements OnInit {
pageNum = 1; // 页码
pageSize = 10; // 条码
loading = true;
+ income = 0; // 收入
+ expend = 0; // 支出
constructor(
private form: FormBuilder,
@@ -37,6 +39,7 @@ export class UserGoldComponent implements OnInit {
this.searchForm = this.form.group({
goldType: [null],
resType: [null],
+ createTime: [null],
});
this.getRequest(true, this.searchForm.value);
}
@@ -48,6 +51,10 @@ export class UserGoldComponent implements OnInit {
if (reset) {
this.pageNum = 1;
}
+ if (whereObject['createTime'] != null && whereObject['createTime'].length > 0) {
+ whereObject['createTimeS'] = new Date(whereObject['createTime'][0]).getTime();
+ whereObject['createTimeE'] = new Date(whereObject['createTime'][1]).getTime();
+ }
whereObject['pageNum'] = this.pageNum;
whereObject['pageSize'] = this.pageSize;
this.user.getGoldRecList(whereObject, data => {
@@ -58,6 +65,20 @@ export class UserGoldComponent implements OnInit {
this.message.error(data['return_msg']);
}
});
+ this.user.queryGold(whereObject , data => {
+ this.income = 0;
+ this.expend = 0;
+ if (data['return_code'] === '000000') {
+ for (const datum of data['return_data']) {
+ if (datum['gold_type'] === 1) {
+ this.income = datum['sum'];
+ }
+ if (datum['gold_type'] === 2) {
+ this.expend = datum['sum'];
+ }
+ }
+ }
+ });
}
// 重置
diff --git a/src/app/services/user.service.ts b/src/app/services/user.service.ts
index 5ea0a6c..c470a16 100644
--- a/src/app/services/user.service.ts
+++ b/src/app/services/user.service.ts
@@ -48,6 +48,19 @@ export class UserService {
});
}
+ /**
+ * @Author Sum1Dream
+ * @methodName queryGold
+ * @Description //获取金币统计
+ * @Date 16:32 2021/9/22
+ * @Param mod
+ **/
+ public queryGold(paramsObject: object, callBack) {
+ this.http.get(environment.baseUrl + 'highGoldRec/queryGold?' + this.common.getWhereCondition(paramsObject)).subscribe(data => {
+ callBack(data);
+ });
+ }
+
/**
* 获取金币情况
*