|
@@ -26,7 +26,7 @@ func List(ctx context.Context, param model.OrderListParams) (map[string]interfac
|
|
|
if param.IsHelpList {
|
|
|
// 我的订单、高翔、沈炳义查看所有得帮助用户下单的订单
|
|
|
orderSql = append(orderSql, " a.del_status = 0 ")
|
|
|
- countRes, _ := g.DB().GetCount(ctx, fmt.Sprintf(`SELECT count(1) from cadmin.request_auth WHERE user_id = %d and request_call = 'Baiy.Cadmin.Order.helpUserOrders'`, adminId))
|
|
|
+ countRes, _ := g.DB().GetCount(ctx, fmt.Sprintf(`SELECT * from cadmin.request_auth WHERE user_id = %d and request_call = 'Baiy.Cadmin.Order.helpUserOrders'`, adminId))
|
|
|
if countRes > 0 {
|
|
|
orderSql = append(orderSql, " a.order_channel = 'xdqd04' ")
|
|
|
} else {
|
|
@@ -135,7 +135,7 @@ LEFT JOIN (
|
|
|
invoice_status = 1 and invoice_changed = 0
|
|
|
GROUP BY
|
|
|
order_code
|
|
|
-) b ON a.order_code = b.order_code
|
|
|
+) b ON a.order_code = b.order_code
|
|
|
LEFT JOIN (
|
|
|
SELECT
|
|
|
order_code,
|
|
@@ -172,7 +172,7 @@ LEFT JOIN (
|
|
|
WHERE
|
|
|
%s`
|
|
|
sql := fmt.Sprintf(sqlWhere, " a.id,\n a.order_code,\n a.create_time,\n a.company_name,\n a.user_phone,\n a.user_nickname,\n a.buy_subject,\n a.audit_status,\n a.order_status,\n a.pay_money - IFNULL(g.orderMoney, 0) as pay_money,\n a.commission,\n a.return_status,\n IFNULL(c.return_money, 0) as return_money,\n IFNULL(b.invoiced_amount, 0) as invoiced_amount,\n a.refund_status,\n IFNULL(d.refund_money, 0) as refund_money,\n f.ent_userId,\n e.contract_status,\n e.contract_time,\n e.contract_archive_status,\n e.contract_archive_time,\n (SELECT id FROM jy_order_detail where order_code = a.order_code order by final_price desc, id desc LIMIT 1) as order_detail_id ", adminId, strings.Join(orderSql, " and "))
|
|
|
- sqlCount := fmt.Sprintf(sqlWhere, " count(1) ", adminId, strings.Join(orderSql, " and "))
|
|
|
+ sqlCount := fmt.Sprintf(sqlWhere, " * ", adminId, strings.Join(orderSql, " and "))
|
|
|
|
|
|
log.Println("list count sql :", sqlCount)
|
|
|
log.Println("list sql :", sql)
|
|
@@ -193,6 +193,7 @@ WHERE
|
|
|
continue
|
|
|
}
|
|
|
m["service_type"] = jyOrderDetail.Map()["service_type"]
|
|
|
+ m["filter"] = jyOrderDetail.Map()["filter"]
|
|
|
//未回款金额
|
|
|
m["no_return_money"] = gconv.Int(m["pay_money"]) - gconv.Int(m["return_money"]) - gconv.Int(m["commission"])
|
|
|
//未退款金额
|