|
@@ -136,6 +136,28 @@ class ChatService extends CrudService {
|
|
|
dock.vipuser.push(vipuser);
|
|
|
return await dock.save();
|
|
|
}
|
|
|
+
|
|
|
+ async dockfetch({ id }) {
|
|
|
+ const dock = await this.model.findById(id);
|
|
|
+ const data = JSON.parse(JSON.stringify(dock));
|
|
|
+ if (dock) {
|
|
|
+ const applydata = [];
|
|
|
+ for (const elm of dock.apply) {
|
|
|
+ const url = 'http://localhost:9004/api/market/transaction?userid=' + elm.user_id;
|
|
|
+ const res = await this.ctx.curl(url, {
|
|
|
+ method: 'get',
|
|
|
+ headers: {
|
|
|
+ 'content-type': 'application/json',
|
|
|
+ },
|
|
|
+ dataType: 'json',
|
|
|
+ });
|
|
|
+ const newdata = { ...JSON.parse(JSON.stringify(elm)), transdata: res.data.data };
|
|
|
+ applydata.push(newdata);
|
|
|
+ }
|
|
|
+ data.apply = applydata;
|
|
|
+ }
|
|
|
+ return data;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
module.exports = ChatService;
|