|
@@ -76,7 +76,7 @@ WHERE b.phone = '%s' and a.name = '%s'`, param.Phone, param.EntName))
|
|
}
|
|
}
|
|
orderDetailType, _ := g.DB().Query(ctx, fmt.Sprintf(`SELECT DISTINCT(jod.product_type) FROM jy_order_detail jod
|
|
orderDetailType, _ := g.DB().Query(ctx, fmt.Sprintf(`SELECT DISTINCT(jod.product_type) FROM jy_order_detail jod
|
|
INNER JOIN dataexport_order dor on jod.order_code = dor.order_code
|
|
INNER JOIN dataexport_order dor on jod.order_code = dor.order_code
|
|
-WHERE %s order by dor.create_time desc`, whereSql))
|
|
|
|
|
|
+WHERE %s and jod.status =1 order by dor.create_time desc`, whereSql))
|
|
if orderDetailType.IsEmpty() {
|
|
if orderDetailType.IsEmpty() {
|
|
return map[string]interface{}{
|
|
return map[string]interface{}{
|
|
"willEffect": false,
|
|
"willEffect": false,
|
|
@@ -305,7 +305,7 @@ WHERE a.ent_id = '%s' %s and a.product_type like '%s' ORDER BY a.end_time desc
|
|
case strings.Contains(productType, "大会员"):
|
|
case strings.Contains(productType, "大会员"):
|
|
//大会员获取下服务最新id
|
|
//大会员获取下服务最新id
|
|
serviceId, _ := g.DB().GetOne(ctx, fmt.Sprintf(`SELECT b.filter FROM entniche_order a
|
|
serviceId, _ := g.DB().GetOne(ctx, fmt.Sprintf(`SELECT b.filter FROM entniche_order a
|
|
- INNER JOIN jy_order_detail b on a.order_detail_id = b.id WHERE a.wait_empower_id = %d ORDER BY a.create_time desc LIMIT 1`, gconv.Int(m["id"])))
|
|
|
|
|
|
+ INNER JOIN jy_order_detail b on a.order_detail_id = b.id WHERE a.wait_empower_id = %d and b.status =1 ORDER BY a.create_time desc LIMIT 1`, gconv.Int(m["id"])))
|
|
if !serviceId.IsEmpty() {
|
|
if !serviceId.IsEmpty() {
|
|
comboId = gconv.Int(gconv.Map(serviceId.Map()["filter"])["comboId"])
|
|
comboId = gconv.Int(gconv.Map(serviceId.Map()["filter"])["comboId"])
|
|
itemMap, _ := g.DB().GetOne(ctx, fmt.Sprintf(`SELECT code FROM jy_product_item WHERE JSON_EXTRACT(price, '$.comboId') = %d;`, comboId))
|
|
itemMap, _ := g.DB().GetOne(ctx, fmt.Sprintf(`SELECT code FROM jy_product_item WHERE JSON_EXTRACT(price, '$.comboId') = %d;`, comboId))
|
|
@@ -337,7 +337,7 @@ WHERE a.ent_id = '%s' %s and a.product_type like '%s' ORDER BY a.end_time desc
|
|
//获取订单
|
|
//获取订单
|
|
entOrderService, _ := g.DB().Query(ctx, fmt.Sprintf(`SELECT b.id,b.service_type,b.order_code,c.create_time,b.service_starttime,b.service_endtime,b.filter FROM entniche_order a
|
|
entOrderService, _ := g.DB().Query(ctx, fmt.Sprintf(`SELECT b.id,b.service_type,b.order_code,c.create_time,b.service_starttime,b.service_endtime,b.filter FROM entniche_order a
|
|
INNER JOIN jy_order_detail b on a.order_detail_id = b.id
|
|
INNER JOIN jy_order_detail b on a.order_detail_id = b.id
|
|
- LEFT JOIN dataexport_order c on b.order_code = c.order_code WHERE a.wait_empower_id = %d order by b.id desc`, gconv.Int(m["id"])))
|
|
|
|
|
|
+ LEFT JOIN dataexport_order c on b.order_code = c.order_code WHERE a.wait_empower_id = %d and b.status =1 order by b.id desc`, gconv.Int(m["id"])))
|
|
if !entOrderService.IsEmpty() {
|
|
if !entOrderService.IsEmpty() {
|
|
for _, m2 := range entOrderService.List() {
|
|
for _, m2 := range entOrderService.List() {
|
|
if linkedId == 0 {
|
|
if linkedId == 0 {
|
|
@@ -412,7 +412,7 @@ func SpecialService(ctx context.Context, phone, productType string, buySubject i
|
|
|
|
|
|
orderData, _ := g.DB().Query(ctx, fmt.Sprintf(`SELECT jod.product_code,jod.service_endtime,jod.id,jod.service_starttime,jod.service_type,jod.order_code,dor.create_time FROM dataexport_order dor
|
|
orderData, _ := g.DB().Query(ctx, fmt.Sprintf(`SELECT jod.product_code,jod.service_endtime,jod.id,jod.service_starttime,jod.service_type,jod.order_code,dor.create_time FROM dataexport_order dor
|
|
INNER JOIN jy_order_detail jod on dor.order_code = jod.order_code
|
|
INNER JOIN jy_order_detail jod on dor.order_code = jod.order_code
|
|
-WHERE %s and dor.product_type = '%s' ORDER BY dor.create_time desc `, phone, productType))
|
|
|
|
|
|
+WHERE %s and dor.product_type = '%s' and jod.status =1 ORDER BY dor.create_time desc `, phone, productType))
|
|
if !orderData.IsEmpty() {
|
|
if !orderData.IsEmpty() {
|
|
for _, m2 := range orderData.List() {
|
|
for _, m2 := range orderData.List() {
|
|
if linkedId == 0 {
|
|
if linkedId == 0 {
|