- first edition of long pulling

This commit is contained in:
gazebo
2019-03-05 22:35:20 +08:00
parent aef4ab7348
commit ccf9a4d6b9
5 changed files with 238 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
package dao
import (
"time"
"git.rosy.net.cn/jx-callback/business/model"
)
func GetStoreOrderAfterTime(db *DaoDB, storeID int, orderTime time.Time, lastOrderSeqID int64) (orderList []*model.GoodsOrderExt, err error) {
sql := `
SELECT t1.*,
t2.status waybill_status, t2.courier_name, t2.courier_mobile,
t2.actual_fee, t2.desired_fee, t2.waybill_created_at, t2.waybill_finished_at
FROM goods_order t1
LEFT JOIN waybill t2 ON t1.vendor_waybill_id = t2.vendor_waybill_id AND t1.waybill_vendor_id = t2.waybill_vendor_id
WHERE IF(t1.jx_store_id <> 0, t1.jx_store_id, t1.store_id) = ? AND t1.order_created_at >= ? AND t1.id > ?
LIMIT 50;
`
sqlParams := []interface{}{
storeID,
orderTime,
lastOrderSeqID,
}
return orderList, GetRows(db, &orderList, sql, sqlParams...)
}