|
@@ -26,7 +26,7 @@ const (
|
26
|
26
|
// GetCaseRecord 获取案场月记录
|
27
|
27
|
func (m *CaseDAO) GetCaseRecord(caseids string, page, pageSize int) ([]CaseRecord, error) {
|
28
|
28
|
var records []CaseRecord
|
29
|
|
- sql := `select * from sys_case_record where case_id in ('` + strings.Replace(caseids, ",", "','", -1) + `') and status>` + strconv.Itoa(models.STATUS_DEL) + ` order by create_date desc limit ` + strconv.Itoa((page-1)*pageSize) + `, ` + strconv.Itoa(pageSize)
|
|
29
|
+ sql := `select * from sys_case_record where case_id in ('` + strings.Replace(caseids, ",", "','", -1) + `') and status>` + strconv.Itoa(models.STATUS_DEL) + `' order by create_date desc limit ` + strconv.Itoa((page-1)*pageSize) + `, ` + strconv.Itoa(pageSize)
|
30
|
30
|
|
31
|
31
|
err := m.db.Sql(sql).Find(&records)
|
32
|
32
|
if err != nil {
|
|
@@ -34,7 +34,7 @@ func (m *CaseDAO) GetCaseRecord(caseids string, page, pageSize int) ([]CaseRecor
|
34
|
34
|
}
|
35
|
35
|
for inx, record := range records {
|
36
|
36
|
orders := new(model.TaGoodsOrders)
|
37
|
|
- total, err := m.db.Where("case_id=?", record.CaseId).And("status=?", models.STATUS_NORMAL).And("user_type in ('"+goods.USERTPE_SALES+"','"+goods.USERTYPE_MANAGER+"')").And("date_format(create_date,'%Y-%m')=?", record.Month).And("make_status !=?", "cancel").Sums(orders, "orders_num")
|
|
37
|
+ total, err := m.db.Where("case_id=?", record.CaseId).And("status=?", models.STATUS_NORMAL).And("user_type in ('"+goods.USERTPE_SALES+"','"+goods.USERTYPE_MANAGER+"')").And("date_format(create_date,'%Y-%m')=?", record.Month).And("make_status !=?", "cancel").And("pay_type = ?", models.CONSUME_INNER).Sums(orders, "orders_num")
|
38
|
38
|
if err != nil {
|
39
|
39
|
return nil, err
|
40
|
40
|
}
|