- new field GoodsOrder.Flag
- SetOrderPrintStatus
This commit is contained in:
@@ -180,6 +180,9 @@ const (
|
||||
OrderDeliveryFlagMaskScheduleDisabled = 1 // 禁止三方配送调度
|
||||
OrderDeliveryFlagMaskPurcahseDisabled = 2 // 购物平台已不配送(一般为门店配送类型本身为自配送,或已经转自配送)
|
||||
)
|
||||
const (
|
||||
OrderFlagMaskPrinted = 1 // 已经打印
|
||||
)
|
||||
|
||||
func IsPurchaseVendorExist(vendorID int) bool {
|
||||
_, ok := VendorNames[vendorID]
|
||||
|
||||
@@ -13,13 +13,38 @@ func GetStoreOrderAfterTime(db *DaoDB, storeID int, orderTime time.Time, lastOrd
|
||||
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;
|
||||
WHERE IF(t1.jx_store_id <> 0, t1.jx_store_id, t1.store_id) = ? AND t1.order_created_at >= ? AND t1.id > ? AND t1.status <= ?;
|
||||
`
|
||||
sqlParams := []interface{}{
|
||||
storeID,
|
||||
orderTime,
|
||||
lastOrderSeqID,
|
||||
model.OrderStatusDelivering,
|
||||
}
|
||||
return orderList, GetRows(db, &orderList, sql, sqlParams...)
|
||||
}
|
||||
|
||||
func SetOrderPrintFlag(db *DaoDB, vendorOrderID string, vendorID int, isPrinted bool) (err error) {
|
||||
var (
|
||||
sql string
|
||||
sqlParams []interface{}
|
||||
)
|
||||
if isPrinted {
|
||||
sql = `
|
||||
UPDATE goods_order
|
||||
SET flag = flag | ?
|
||||
WHERE vendor_order_id = ? AND vendor_id = ?
|
||||
`
|
||||
sqlParams = append(sqlParams, model.OrderFlagMaskPrinted)
|
||||
} else {
|
||||
sql = `
|
||||
UPDATE goods_order
|
||||
SET flag = flag & ?
|
||||
WHERE vendor_order_id = ? AND vendor_id = ?
|
||||
`
|
||||
sqlParams = append(sqlParams, ^model.OrderFlagMaskPrinted)
|
||||
}
|
||||
sqlParams = append(sqlParams, vendorOrderID, vendorID)
|
||||
_, err = ExecuteSQL(db, sql, sqlParams...)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -46,15 +46,16 @@ type GoodsOrder struct {
|
||||
StatusTime time.Time `orm:"type(datetime)" json:"-"` // last status time
|
||||
PickDeadline time.Time `orm:"type(datetime)" json:"pickDeadline"`
|
||||
ModelTimeInfo `json:"-"`
|
||||
OriginalData string `orm:"-" json:"-"`
|
||||
OriginalData string `orm:"-" json:"-"` // 只是用于传递数据
|
||||
Skus []*OrderSku `orm:"-" json:"-"`
|
||||
SkuPmFee int64 `json:"-"` //门店商品活动总支出
|
||||
OrderPmFee int64 `json:"-"` //门店订单活动支出
|
||||
SkuPmSubsidy int64 `json:"-"` //平台商品活动总补贴
|
||||
OrderPmSubsidy int64 `json:"-"` //平台订单活动补贴
|
||||
BoxFee int64 `json:"-"` //餐盒费
|
||||
PlatformFeeRate int16 `json:"-"` //平台费
|
||||
BillStoreFreightFee int64 `json:"-"` //需要回调,门店所承担的运费
|
||||
Flag int8 `json:"flag"` //非运单调整相关的其它状态
|
||||
SkuPmFee int64 `json:"-"` //门店商品活动总支出
|
||||
OrderPmFee int64 `json:"-"` //门店订单活动支出
|
||||
SkuPmSubsidy int64 `json:"-"` //平台商品活动总补贴
|
||||
OrderPmSubsidy int64 `json:"-"` //平台订单活动补贴
|
||||
BoxFee int64 `json:"-"` //餐盒费
|
||||
PlatformFeeRate int16 `json:"-"` //平台费
|
||||
BillStoreFreightFee int64 `json:"-"` //需要回调,门店所承担的运费
|
||||
}
|
||||
|
||||
func (o *GoodsOrder) TableUnique() [][]string {
|
||||
|
||||
Reference in New Issue
Block a user