作者 唐旭辉

更新

@@ -1056,7 +1056,7 @@ func (service OrderInfoService) buildOrderBestshopInfoData(orderBase *domain.Ord @@ -1056,7 +1056,7 @@ func (service OrderInfoService) buildOrderBestshopInfoData(orderBase *domain.Ord
1056 order := map[string]interface{}{ 1056 order := map[string]interface{}{
1057 "orderId": orderBase.Id, 1057 "orderId": orderBase.Id,
1058 "orderState": orderBestshop.OrderState, 1058 "orderState": orderBestshop.OrderState,
1059 - "customers": orderBestshop.BuyerName, 1059 + "customers": orderBase.Buyer.BuyerName,
1060 "address": orderBestshop.BuyerAddress, 1060 "address": orderBestshop.BuyerAddress,
1061 "remarks": orderBestshop.BuyerRemark, 1061 "remarks": orderBestshop.BuyerRemark,
1062 "partner": orderBase.PartnerInfo.PartnerName, 1062 "partner": orderBase.PartnerInfo.PartnerName,
@@ -270,33 +270,33 @@ func (dao OrderBaseDao) OrderListForExcel(companyId int64, partnerOrCode string, @@ -270,33 +270,33 @@ func (dao OrderBaseDao) OrderListForExcel(companyId int64, partnerOrCode string,
270 if len(partnerOrCode) > 0 { 270 if len(partnerOrCode) > 0 {
271 like := "%" + partnerOrCode + "%" 271 like := "%" + partnerOrCode + "%"
272 params = append(params, like, like, like) 272 params = append(params, like, like, like)
273 - sqlstr += " AND (t1.order_code like ? OR t1.delivery_code like ? OR t2.partner_name like ? )" 273 + sqlstr += " AND (t1.order_code like ? OR t1.delivery_code like ? OR t2.partner_name like ? ) "
274 } 274 }
275 275
276 if partnerCategory > 0 { 276 if partnerCategory > 0 {
277 params = append(params, partnerCategory) 277 params = append(params, partnerCategory)
278 - sqlstr += ` AND t1.partner_category@>'{"id":?}'` 278 + sqlstr += ` AND t1.partner_category@>'{"id":?}' `
279 } 279 }
280 280
281 if len(updateTime[0]) > 0 { 281 if len(updateTime[0]) > 0 {
282 params = append(params, updateTime[0]) 282 params = append(params, updateTime[0])
283 - sqlstr += ` AND t1.update_time>=?` 283 + sqlstr += ` AND t1.update_time>=? `
284 } 284 }
285 285
286 if len(updateTime[1]) > 0 { 286 if len(updateTime[1]) > 0 {
287 params = append(params, updateTime[1]) 287 params = append(params, updateTime[1])
288 - sqlstr += ` AND t1.update_time<=?` 288 + sqlstr += ` AND t1.update_time<=? `
289 } 289 }
290 290
291 if len(createTime[0]) > 0 { 291 if len(createTime[0]) > 0 {
292 params = append(params, createTime[0]) 292 params = append(params, createTime[0])
293 - sqlstr += `AND t1.create_time>=?` 293 + sqlstr += ` AND t1.create_time>=? `
294 } 294 }
295 if len(createTime[1]) > 0 { 295 if len(createTime[1]) > 0 {
296 params = append(params, createTime[1]) 296 params = append(params, createTime[1])
297 - sqlstr += ` AND t1.create_time<=?` 297 + sqlstr += ` AND t1.create_time<=? `
298 } 298 }
299 - sqlstr += ` t1.create_time DESC limit 10000` 299 + sqlstr += ` ORDER BY t1.create_time DESC limit 10000 `
300 tx := dao.transactionContext.GetDB() 300 tx := dao.transactionContext.GetDB()
301 _, err = tx.Query(&result, sqlstr, params...) 301 _, err = tx.Query(&result, sqlstr, params...)
302 if err != nil { 302 if err != nil {