|
@@ -239,3 +239,17 @@ func (m *GoodsDAO) GetCustomerOrdersCount(custID string) (int, error) {
|
239
|
239
|
}
|
240
|
240
|
return len(orderList), nil
|
241
|
241
|
}
|
|
242
|
+
|
|
243
|
+// GetOrdersCountByCase 根据案场获取订单信息
|
|
244
|
+func (m *GoodsDAO) GetOrdersCountByCase(caseid string) (int64, error) {
|
|
245
|
+ order := new(model.TaGoodsOrders)
|
|
246
|
+ total, err := m.db.Where("case_id = ?", caseid).And("status>"+strconv.Itoa(models.STATUS_DEL)).SumInt(order, "orders_num")
|
|
247
|
+ return total, err
|
|
248
|
+}
|
|
249
|
+
|
|
250
|
+// GetMonthOrdersCountByCase 获取案场本月的订单数量
|
|
251
|
+func (m *GoodsDAO) GetMonthOrdersCountByCase(caseid string) (int64, error) {
|
|
252
|
+ order := new(model.TaGoodsOrders)
|
|
253
|
+ total, err := m.db.Where("case_id = ?", caseid).And("status>"+strconv.Itoa(models.STATUS_DEL)).And("date_format(create_date,'%Y-%m')=date_format(NOW(),'%Y-%m')").SumInt(order, "orders_num")
|
|
254
|
+ return total, err
|
|
255
|
+}
|