Commit a6fe728f by DESKTOP-7Q3CA17\86137

gsb

parent 6e93d134
......@@ -323,6 +323,11 @@ class ChannelApi {
return;
}
for (let order of orders) {
//查询打款时间
let paytime = await this.esettleSve.paytime(order.id) || [];
if(paytime){
order.pay_complete_time = paytime[0].create_time;
}
// 获取推送数据
let pushData = this.getPushData(merchant, order);
......@@ -370,12 +375,13 @@ class ChannelApi {
"thirdPartyCustomerId": this.trim(merchant.id).toString(),// 第三方客户id
// "productId": "5e6b02cc3290c3000a3a63dc",// 云服产品id (测试环境)
"productId": settings.FQYF().productId,// 云服产品id (生产环境)
// "allotRatio":"50",// 分润比例(百分比的数字部分(如:50代表50%))
"orderPrice": system.f2y(order.deduct_amt),// 订单金额
"productQuantity": "1",// 产品数量
"companyName": merchant.merchant_name,// 公司名称
"phone": merchant.contact_mobile
"phone": merchant.contact_mobile,
"pay_time": moment(order.pay_complete_time).add(-8, "hours").format("YYYY-MM-DD HH:mm:ss"),
"createdat": moment(order.created_at).add(-8, "hours").format("YYYY-MM-DD HH:mm:ss"),
};
var log = {
"data_id": this.trim(order.id), // 发薪批次id tbl_order.id 或者 c_esettle_offline.id
......@@ -531,7 +537,8 @@ class ChannelApi {
rtn = await rc.post(this.FQURL.pushOrderSum, pushData);
// console.log(pushData);
console.log(rtn);
}catch (e) {
return rtn
} catch (e) {
console.log(e)
}
......
......@@ -927,7 +927,7 @@ class EsettleService extends ServiceBase {
}
let sql = [];
sql.push("SELECT");
sql.push("id, deduct_amt ");
sql.push("id, deduct_amt,create_time as created_at ");
sql.push("FROM `tbl_order` ");
sql.push("WHERE busi_id = :busiId");
sql.push("AND create_time >= :begin");
......@@ -940,6 +940,27 @@ class EsettleService extends ServiceBase {
return list;
}
async paytime(orderid){
if (!orderid) {
return [];
}
let sql = [];
sql.push("SELECT");
sql.push("t2.create_time");
sql.push("FROM `tbl_order_item` t1 ");
sql.push("INNER JOIN `tbl_order_item_info` t2 ON t1.`id` = t2.`order_item_id`")
sql.push("WHERE t2.trade_status = '00'")
sql.push("AND t1.`order_id` = :orderid");
sql.push("ORDER BY t2.create_time ASC LIMIT 1");
var list = await this.settledb.query(sql.join(" "), { replacements: { orderid: orderid} });
if (list && list.length > 0) {
list = list[0, 0] || [];
}
return list;
}
async busiStatByDay(day) {
if (!day) {
return [];
......
......@@ -354,7 +354,7 @@ class EsettleofflineService extends ServiceBase {
}
let sql = [];
sql.push("SELECT");
sql.push("id, amt as deduct_amt");
sql.push("id, amt as deduct_amt, created_at, pay_complete_time");
sql.push("FROM `c_esettle_offline` ");
sql.push("WHERE ecompany_id = :companyId");
sql.push("AND created_at >= :begin");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment