zjxpcyc пре 6 година
родитељ
комит
db8ad043de

+ 1
- 1
conf/db.conf Прегледај датотеку

@@ -15,7 +15,7 @@ db_port      = 3306
15 15
 username     = spaceofcheng
16 16
 
17 17
 ; 密码
18
-password     = c;a|vK)Xv/=L@c[6Fx,v[ITD5;WpR}+Y
18
+password     = spaceofcheng
19 19
 
20 20
 ; 数据库名或者schema
21 21
 database     = spaceofcheng

+ 1
- 1
conf/log.conf Прегледај датотеку

@@ -1,4 +1,4 @@
1 1
 [common]
2
-filename="E:\\GoProjects\\src\\spaceofcheng\\services\\log\\common.log"
2
+filename="E:\\GoProject\\src\\spaceofcheng\\services\\log\\common.log"
3 3
 # log level "emergency", "alert", "critical", "error", "warning", "notice", "info", "debug"
4 4
 level="debug"

+ 8
- 0
controllers/customer/customer.go Прегледај датотеку

@@ -4,6 +4,7 @@ import (
4 4
 	"errors"
5 5
 	"net/http"
6 6
 	"spaceofcheng/services/controllers"
7
+	"spaceofcheng/services/models"
7 8
 	"spaceofcheng/services/models/model"
8 9
 	"spaceofcheng/services/service/customer"
9 10
 	"spaceofcheng/services/utils"
@@ -72,6 +73,13 @@ func (c *CustomerController) GetCustWXByID() {
72 73
 		c.ResponseError(errors.New("获取用户信息失败, 请重试"))
73 74
 	}
74 75
 
76
+	if cust.MapUser != "" && cust.BelongCaseStatus != models.STATUS_NORMAL {
77
+		c.ResponseError(
78
+			errors.New("案场状态异常!"),
79
+			http.StatusMethodNotAllowed,
80
+		)
81
+	}
82
+
75 83
 	c.ResponseJSON(map[string]interface{}{
76 84
 		"customer": cust,
77 85
 	})

+ 22
- 5
controllers/goods/order.go Прегледај датотеку

@@ -4,7 +4,7 @@ import (
4 4
 	"encoding/json"
5 5
 	"errors"
6 6
 	"net/http"
7
-	"spaceofcheng/services/models"
7
+	"spaceofcheng/services/models/goods"
8 8
 	"spaceofcheng/services/models/model"
9 9
 	"spaceofcheng/services/utils"
10 10
 	"strconv"
@@ -183,7 +183,6 @@ func (c *GoodsController) GetOrdersByRecord() {
183 183
 				order.UserName,
184 184
 				strconv.Itoa(good.Number),
185 185
 				good.Price,
186
-				strconv.Itoa(good.Number),
187 186
 			})
188 187
 
189 188
 			price, err := strconv.ParseFloat(good.Price, 64)
@@ -199,9 +198,17 @@ func (c *GoodsController) GetOrdersByRecord() {
199 198
 
200 199
 			excel.SetCell(row, strconv.FormatFloat(charge, 'f', -1, 64))
201 200
 
202
-			status := "未完成"
203
-			if order.Status == models.STATUS_NORMAL {
204
-				status = "已完成"
201
+			status := "已完成"
202
+			switch order.MakeStatus {
203
+			case goods.MAKESTATUS_NOTSTARTED:
204
+				status = "制作中"
205
+				break
206
+			case goods.MAKESTATUS_DOING:
207
+				status = "制作中"
208
+				break
209
+			case goods.MAKESTATUS_CANCEL:
210
+				status = "已取消"
211
+				break
205 212
 			}
206 213
 			excel.SetCell(row, status)
207 214
 			excel.SetCell(row, order.CreateDate.Format("2006-01-02 15:04:05"))
@@ -262,3 +269,13 @@ func (c *GoodsController) CancelMake() {
262 269
 	}
263 270
 	c.ResponseJSON("操作成功!")
264 271
 }
272
+
273
+// UpdateOrdersIntimidate 更新订单打单状态
274
+func (c *GoodsController) UpdateOrdersIntimidate() {
275
+	id := c.GetString(":id")
276
+	err := c.serv.UpdateOrdersIntimidate(id)
277
+	if err != nil {
278
+		c.ResponseError(err)
279
+	}
280
+	c.ResponseJSON("操作成功!")
281
+}

+ 8
- 2
controllers/statistics/goods.go Прегледај датотеку

@@ -132,14 +132,13 @@ func (c *StatisticsController) GetGoodsOrdersStatisticsExcel() {
132 132
 		"订单状态",
133 133
 		"商品",
134 134
 		"数量",
135
-		"金额",
135
+		"单价",
136 136
 		"桌位",
137 137
 		"下单人",
138 138
 		"电话",
139 139
 	})
140 140
 
141 141
 	for _, item := range list {
142
-		row := excel.InsertRow()
143 142
 		usertype := ""
144 143
 		switch item.UserType {
145 144
 		case "customer":
@@ -160,10 +159,16 @@ func (c *StatisticsController) GetGoodsOrdersStatisticsExcel() {
160 159
 			orderStatus = "已取消"
161 160
 		}
162 161
 		for _, detail := range item.Details {
162
+			row := excel.InsertRow()
163 163
 			name := detail.GoodsName
164 164
 			if detail.SpecName != "" {
165 165
 				name = name + "(" + detail.SpecName + ")"
166 166
 			}
167
+			// price, err := strconv.ParseFloat(detail.Price, 64)
168
+			// if err != nil {
169
+			// 	c.ResponseError(errors.New("金额类型不正确!"))
170
+			// }
171
+			// amount := price * float64(detail.Number)
167 172
 			excel.SetCell(row, []string{
168 173
 				item.OrdersNo,
169 174
 				item.CaseName,
@@ -172,6 +177,7 @@ func (c *StatisticsController) GetGoodsOrdersStatisticsExcel() {
172 177
 				orderStatus,
173 178
 				name,
174 179
 				strconv.Itoa(detail.Number),
180
+				detail.Price,
175 181
 				item.AreaName + item.TableNo,
176 182
 				item.CustomerName,
177 183
 				item.Phone,

+ 118
- 0
log/common.log Прегледај датотеку

@@ -0,0 +1,118 @@
1
+<<<<<<< HEAD
2
+=======
3
+2018/09/21 00:04:05 [E] 用户没有设置默认案场
4
+2018/09/21 00:04:05 [E] 用户没有设置默认案场
5
+2018/09/21 00:04:05 [E] 用户没有设置默认案场
6
+2018/09/21 00:04:14 [E] 用户没有设置默认案场
7
+2018/09/21 00:04:17 [E] 用户没有设置默认案场
8
+2018/09/21 00:04:19 [E] 用户没有设置默认案场
9
+2018/09/21 00:05:17 [E] 用户没有设置默认案场
10
+2018/09/21 00:05:26 [E] 用户没有设置默认案场
11
+2018/09/21 00:05:26 [E] 用户没有设置默认案场
12
+2018/09/21 00:30:14 [E] 用户没有设置默认案场
13
+2018/09/21 00:30:14 [E] 用户没有设置默认案场
14
+2018/09/21 00:30:37 [E] 用户没有设置默认案场
15
+2018/09/21 00:30:45 [E] 用户没有设置默认案场
16
+2018/09/21 00:30:46 [E] 用户没有设置默认案场
17
+2018/09/21 00:32:11 [E] 用户没有设置默认案场
18
+2018/09/21 00:36:16 [E] 用户没有设置默认案场
19
+2018/09/21 00:36:16 [E] 用户没有设置默认案场
20
+2018/09/21 00:36:16 [E] 用户没有设置默认案场
21
+2018/09/21 00:36:39 [E] 用户没有设置默认案场
22
+2018/09/21 00:36:45 [E] 用户没有设置默认案场
23
+2018/09/21 00:36:49 [E] 用户没有设置默认案场
24
+2018/09/21 00:36:58 [E] 用户没有设置默认案场
25
+2018/09/21 00:37:04 [E] 用户没有设置默认案场
26
+2018/09/21 00:37:36 [E] 用户没有设置默认案场
27
+2018/09/21 00:37:36 [E] 用户没有设置默认案场
28
+2018/09/21 00:37:38 [E] 用户没有设置默认案场
29
+2018/09/21 00:37:40 [E] 用户没有设置默认案场
30
+2018/09/21 00:37:43 [E] 用户没有设置默认案场
31
+2018/09/21 00:37:53 [E] 用户没有设置默认案场
32
+2018/09/21 00:38:05 [E] 用户没有设置默认案场
33
+2018/09/21 00:38:08 [E] 用户没有设置默认案场
34
+2018/09/21 00:38:12 [E] 用户没有设置默认案场
35
+2018/09/21 00:38:15 [E] 用户没有设置默认案场
36
+2018/09/21 00:38:49 [E] 用户没有设置默认案场
37
+2018/09/21 00:38:51 [E] 用户没有设置默认案场
38
+2018/09/21 00:38:53 [E] 用户没有设置默认案场
39
+2018/09/21 00:38:53 [E] 用户没有设置默认案场
40
+2018/09/21 00:38:55 [E] 用户没有设置默认案场
41
+2018/09/21 00:38:56 [E] 用户没有设置默认案场
42
+2018/09/21 00:38:59 [E] 用户没有设置默认案场
43
+2018/09/21 00:39:02 [E] 用户没有设置默认案场
44
+2018/09/21 00:39:12 [E] 用户没有设置默认案场
45
+2018/09/21 00:39:24 [E] 用户没有设置默认案场
46
+2018/09/21 00:45:56 [E] 用户没有设置默认案场
47
+2018/09/21 00:45:56 [E] 用户没有设置默认案场
48
+2018/09/21 00:46:37 [E] 用户没有设置默认案场
49
+2018/09/21 00:46:37 [E] 用户没有设置默认案场
50
+2018/09/21 00:47:06 [E] 用户没有设置默认案场
51
+2018/09/21 00:47:06 [E] 用户没有设置默认案场
52
+2018/09/21 00:47:47 [E] 用户没有设置默认案场
53
+2018/09/21 00:47:47 [E] 用户没有设置默认案场
54
+2018/09/21 00:48:12 [E] 用户没有设置默认案场
55
+2018/09/21 00:49:04 [E] 用户没有设置默认案场
56
+2018/09/21 00:53:33 [E] 用户没有设置默认案场
57
+2018/09/21 00:53:33 [E] 用户没有设置默认案场
58
+2018/09/21 00:53:51 [E] 用户没有设置默认案场
59
+2018/09/21 00:53:52 [E] 用户没有设置默认案场
60
+2018/09/21 00:53:52 [E] 用户没有设置默认案场
61
+2018/09/21 00:53:56 [E] 用户没有设置默认案场
62
+2018/09/21 00:53:58 [E] 用户没有设置默认案场
63
+2018/09/21 00:54:12 [E] 用户没有设置默认案场
64
+2018/09/21 00:54:12 [E] 用户没有设置默认案场
65
+2018/09/21 01:01:20 [E] 用户没有设置默认案场
66
+2018/09/21 01:03:52 [E] 用户没有设置默认案场
67
+2018/09/21 01:03:52 [E] 用户没有设置默认案场
68
+2018/09/21 01:04:06 [E] 用户没有设置默认案场
69
+2018/09/21 01:42:44 [E] 用户没有设置默认案场
70
+2018/09/21 01:44:00 [E] 用户没有设置默认案场
71
+2018/09/21 01:44:00 [E] 用户没有设置默认案场
72
+2018/09/21 01:44:05 [E] 用户没有设置默认案场
73
+2018/09/21 01:44:08 [E] 用户没有设置默认案场
74
+2018/09/21 01:44:08 [E] 用户没有设置默认案场
75
+2018/09/21 01:44:10 [E] 用户没有设置默认案场
76
+2018/09/21 01:44:19 [E] 用户没有设置默认案场
77
+2018/09/21 01:45:42 [E] 用户没有设置默认案场
78
+2018/09/21 01:45:45 [E] 用户没有设置默认案场
79
+2018/09/21 01:47:37 [E] 用户没有设置默认案场
80
+2018/09/21 01:47:37 [E] 用户没有设置默认案场
81
+2018/09/21 02:10:32 [E] 用户没有设置默认案场
82
+2018/09/21 02:10:32 [E] 用户没有设置默认案场
83
+2018/09/21 02:10:36 [E] 用户没有设置默认案场
84
+2018/09/21 02:10:37 [E] 用户没有设置默认案场
85
+2018/09/21 02:10:37 [E] 用户没有设置默认案场
86
+2018/09/21 02:10:38 [E] 用户没有设置默认案场
87
+2018/09/21 02:10:41 [E] 用户没有设置默认案场
88
+2018/09/21 02:10:53 [E] 用户没有设置默认案场
89
+2018/09/21 02:11:07 [E] 用户没有设置默认案场
90
+2018/09/21 02:11:08 [E] 用户没有设置默认案场
91
+2018/09/21 02:11:12 [E] 用户没有设置默认案场
92
+2018/09/21 02:11:12 [E] 用户没有设置默认案场
93
+2018/09/21 02:11:29 [E] 用户没有设置默认案场
94
+2018/09/21 02:11:31 [E] 用户没有设置默认案场
95
+2018/09/21 02:11:43 [E] 用户没有设置默认案场
96
+2018/09/21 02:11:53 [E] 用户没有设置默认案场
97
+2018/09/21 02:11:57 [E] 用户没有设置默认案场
98
+2018/09/21 02:11:57 [E] 用户没有设置默认案场
99
+2018/09/21 02:12:12 [E] 用户没有设置默认案场
100
+2018/09/21 02:12:39 [E] 用户没有设置默认案场
101
+2018/09/21 02:12:40 [E] 用户没有设置默认案场
102
+2018/09/21 02:12:40 [E] 用户没有设置默认案场
103
+2018/09/21 02:12:40 [E] 用户没有设置默认案场
104
+2018/09/21 02:12:43 [E] 用户没有设置默认案场
105
+2018/09/21 02:12:47 [E] 用户没有设置默认案场
106
+2018/09/21 02:13:47 [E] 用户没有设置默认案场
107
+2018/09/21 02:13:47 [E] 用户没有设置默认案场
108
+2018/09/21 02:14:10 [E] 用户没有设置默认案场
109
+2018/09/21 02:14:17 [E] 用户没有设置默认案场
110
+2018/09/21 02:14:19 [E] 用户没有设置默认案场
111
+2018/09/21 02:14:20 [E] 用户没有设置默认案场
112
+2018/09/21 02:14:58 [E] 用户没有设置默认案场
113
+2018/09/21 02:15:01 [E] 用户没有设置默认案场
114
+2018/09/21 02:15:02 [E] 用户没有设置默认案场
115
+2018/09/21 02:15:03 [E] 用户没有设置默认案场
116
+2018/09/21 02:15:03 [E] 用户没有设置默认案场
117
+2018/09/21 02:15:03 [E] 用户没有设置默认案场
118
+>>>>>>> 443c1728ef51dbf0d939a5f62ed7e34f0f6708a8

+ 9
- 3
models/cases/cases.go Прегледај датотеку

@@ -59,9 +59,15 @@ func (m *CaseDAO) GetCaseCount(caseids, casename string) (int, error) {
59 59
 
60 60
 // GetCaseByID 根据ID获取案场信息
61 61
 func (m *CaseDAO) GetCaseByID(caseid string) (*model.SysCase, error) {
62
-	cs := new(model.SysCase)
63
-	_, err := m.db.Where("status>?", models.STATUS_DEL).And("case_id=?", caseid).Get(cs)
64
-	return cs, err
62
+	var cases []model.SysCase
63
+	err := m.db.Where("status>?", models.STATUS_DEL).And("case_id=?", caseid).Find(&cases)
64
+	if err != nil {
65
+		return nil, err
66
+	}
67
+	if len(cases) > 0 {
68
+		return &cases[0], nil
69
+	}
70
+	return nil, err
65 71
 }
66 72
 
67 73
 // AddCase 新增案场信息

+ 1
- 0
models/customer/types.go Прегледај датотеку

@@ -12,4 +12,5 @@ type CustWithWX struct {
12 12
 	Points              int
13 13
 	MapUser             string
14 14
 	BelongCaseId        string
15
+	BelongCaseStatus    int
15 16
 }

+ 20
- 2
models/goods/orders.go Прегледај датотеку

@@ -15,6 +15,9 @@ import (
15 15
 const (
16 16
 	USERTPE_SALES     = "sales"
17 17
 	USERTYPE_CUSTOMER = "customer"
18
+
19
+	INTIMIDATE_NO  = 0
20
+	INTIMIDATE_YES = 1
18 21
 )
19 22
 
20 23
 // GetOrdersByCases 获取案场订单列表
@@ -44,6 +47,7 @@ func (m *GoodsDAO) SaveOrders(order *model.TaGoodsOrders) error {
44 47
 	order.Status = models.STATUS_NORMAL
45 48
 	order.IsPay = models.BOOL_TRUE // 默认已支付
46 49
 	order.CouponAmount = "0"
50
+	order.IsIntimidate = INTIMIDATE_NO
47 51
 
48 52
 	// 当前订单号的随机方式 = 时间 + 个人ID
49 53
 	ordersno := "G-" + time.Now().Local().Format("20060102150405") + "-" + strings.Join(utils.GUIID2IntString(order.UserId), "")
@@ -56,6 +60,20 @@ func (m *GoodsDAO) SaveOrders(order *model.TaGoodsOrders) error {
56 60
 	return nil
57 61
 }
58 62
 
63
+// UpdateOrdersIntimidate 更新订单已打单
64
+func (m *GoodsDAO) UpdateOrdersIntimidate(id string) error {
65
+	var orders = model.TaGoodsOrders{
66
+		OrdersId:     id,
67
+		IsIntimidate: INTIMIDATE_YES,
68
+	}
69
+	var cols = []string{
70
+		"spec_name",
71
+		"case_id",
72
+	}
73
+	_, err := m.db.Cols(cols...).Where("orders_id=?", orders.OrdersId).Update(orders)
74
+	return err
75
+}
76
+
59 77
 // SaveOrdersDetail 保存订单明细
60 78
 func (m *GoodsDAO) SaveOrdersDetail(list []model.TaGoodsOrdersDetail, ordersID string) error {
61 79
 	for inx := range list {
@@ -222,7 +240,7 @@ func (m *GoodsDAO) GetCustomerOrders(custID string, page, pageSize int) ([]Order
222 240
 	sql := `select a.*, c.case_name from ta_goods_orders a 
223 241
 	inner join sys_case c on a.case_id=c.case_id
224 242
 	where a.user_id='` + custID +
225
-		`' and c.status=` + strconv.Itoa(models.STATUS_NORMAL) + ` and a.status=` + strconv.Itoa(models.STATUS_NORMAL)
243
+		`' and a.status=` + strconv.Itoa(models.STATUS_NORMAL)
226 244
 	sql += ` order by a.create_date desc limit ` + strconv.Itoa((page-1)*pageSize) + `, ` + strconv.Itoa(pageSize)
227 245
 	err := m.db.Sql(sql).Find(&orderList)
228 246
 	if err != nil {
@@ -244,7 +262,7 @@ func (m *GoodsDAO) GetCustomerOrdersCount(custID string) (int, error) {
244 262
 	sql := `select a.*, c.case_name from ta_goods_orders a 
245 263
 	inner join sys_case c on a.case_id=c.case_id
246 264
 	where a.user_id='` + custID +
247
-		`' and c.status=` + strconv.Itoa(models.STATUS_NORMAL) + ` and a.status=` + strconv.Itoa(models.STATUS_NORMAL)
265
+		`' and a.status=` + strconv.Itoa(models.STATUS_NORMAL)
248 266
 	err := m.db.Sql(sql).Find(&orderList)
249 267
 	if err != nil {
250 268
 		return 0, err

+ 1
- 0
models/model/ta_goods_orders.go Прегледај датотеку

@@ -27,4 +27,5 @@ type TaGoodsOrders struct {
27 27
 	IsPay        int    `xorm:"TINYINT(1)"`
28 28
 	ActualAmount string `xorm:"DECIMAL(8,2)"`
29 29
 	CouponAmount string `xorm:"DECIMAL(8,2)"`
30
+	IsIntimidate int    `xorm:"SMALLINT(6)"`
30 31
 }

+ 8
- 3
models/statistics/goods.go Прегледај датотеку

@@ -167,8 +167,7 @@ func (m *StatisticsDAO) GetGoodsOrderStatistics(status, usertype, caseids, begin
167 167
 		return nil, err
168 168
 	}
169 169
 	for inx, item := range orders {
170
-		var details []model.TaGoodsOrdersDetail
171
-		err := m.db.Where("orders_id=?", item.OrdersId).Find(&details)
170
+		details, err := m.GetGoodsOrderDetailByOrderId(item.OrdersId)
172 171
 		if err != nil {
173 172
 			return nil, err
174 173
 		}
@@ -177,6 +176,13 @@ func (m *StatisticsDAO) GetGoodsOrderStatistics(status, usertype, caseids, begin
177 176
 	return orders, err
178 177
 }
179 178
 
179
+// GetGoodsOrderDetailByOrderId 获取商品详情
180
+func (m *StatisticsDAO) GetGoodsOrderDetailByOrderId(ordersid string) ([]model.TaGoodsOrdersDetail, error) {
181
+	var details []model.TaGoodsOrdersDetail
182
+	err := m.db.Where("orders_id=?", ordersid).Find(&details)
183
+	return details, err
184
+}
185
+
180 186
 // GetGoodsOrderStatisticsCount 获取商品订单Count
181 187
 func (m *StatisticsDAO) GetGoodsOrderStatisticsCount(status, usertype, caseids, begindate, enddate string) ([]GoodsOrdersStatistics, error) {
182 188
 	var orders []GoodsOrdersStatistics
@@ -213,7 +219,6 @@ func (m *StatisticsDAO) GetGoodsOrderStatisticsCount(status, usertype, caseids,
213 219
 	if status != "" {
214 220
 		sql = sql + ` and a.make_status='` + status + `'`
215 221
 	}
216
-
217 222
 	err := m.db.Sql(sql).Find(&orders)
218 223
 	return orders, err
219 224
 }

+ 1
- 0
routers/common.go Прегледај датотеку

@@ -247,6 +247,7 @@ func getCommonRoutes() beego.LinkNamespace {
247 247
 
248 248
 		beego.NSRouter("/order/goods/finish/:id", &goods.GoodsController{}, "put:FinishMake"),
249 249
 		beego.NSRouter("/order/goods/cancel/:id", &goods.GoodsController{}, "put:CancelMake"),
250
+		beego.NSRouter("/order/goods/intimidate/:id", &goods.GoodsController{}, "put:UpdateOrdersIntimidate"),
250 251
 
251 252
 		// 优惠券
252 253
 		beego.NSRouter("/coupon", &coupon.CouponController{}, "get:ListByCase"),

+ 22
- 4
service/coupon/coupon.go Прегледај датотеку

@@ -544,6 +544,15 @@ func (s *CouponServ) ReceiveCoupon(id, saleid, serialcode string) error {
544 544
 		return errors.New("log-error-该优惠券已被领取!")
545 545
 	}
546 546
 
547
+	// 计算卡券有效期
548
+	startDate := coupon.StartDate
549
+	endDate := coupon.EndDate
550
+	if coupon.ValidDays > 0 {
551
+		startDate = time.Now().Local()
552
+		hs := int64(coupon.ValidDays * 24)
553
+		endDate = time.Now().Local().Add(time.Hour * time.Duration(hs))
554
+	}
555
+
547 556
 	// 领取
548 557
 	var customerCoupon = model.TaCustomerCoupon{
549 558
 		CouponId:           coupon.CouponId,
@@ -551,8 +560,8 @@ func (s *CouponServ) ReceiveCoupon(id, saleid, serialcode string) error {
551 560
 		CustomerId:         customer.CustomerId,
552 561
 		SalesId:            saler.UserId,
553 562
 		SalesName:          saler.UserName,
554
-		StartDate:          coupon.StartDate,
555
-		EndDate:            coupon.EndDate,
563
+		StartDate:          startDate,
564
+		EndDate:            endDate,
556 565
 		CaseId:             coupon.CaseId,
557 566
 		OrgId:              coupon.OrgId,
558 567
 		SerialCode:         serialcode,
@@ -611,13 +620,22 @@ func (s *CouponServ) ChannelReceiveCoupon(id string) error {
611 620
 		return errors.New("log-error-您已领取过该优惠券!")
612 621
 	}
613 622
 
623
+	// 计算卡券有效期
624
+	startDate := coupon.StartDate
625
+	endDate := coupon.EndDate
626
+	if coupon.ValidDays > 0 {
627
+		startDate = time.Now().Local()
628
+		hs := int64(coupon.ValidDays * 24)
629
+		endDate = time.Now().Local().Add(time.Hour * time.Duration(hs))
630
+	}
631
+
614 632
 	// 领取
615 633
 	var customerCoupon = model.TaCustomerCoupon{
616 634
 		CouponId:           coupon.CouponId,
617 635
 		CustomerCouponName: coupon.CouponName,
618 636
 		CustomerId:         customer.CustomerId,
619
-		StartDate:          coupon.StartDate,
620
-		EndDate:            coupon.EndDate,
637
+		StartDate:          startDate,
638
+		EndDate:            endDate,
621 639
 		CaseId:             coupon.CaseId,
622 640
 		OrgId:              coupon.OrgId,
623 641
 		ReceivingType:      models.RECEIVEING_TYPE_CHANNEL,

+ 1
- 1
service/course/order.go Прегледај датотеку

@@ -107,7 +107,7 @@ func (s *CourseServ) Orders(
107 107
 		var isdy = false
108 108
 		if coupon.IsAll == 1 {
109 109
 			isdy = true
110
-			couseOrder.CouponAmount = couseOrder.Price
110
+			couseOrder.CouponAmount = coupon.Price
111 111
 		} else {
112 112
 			for _, target := range coupon.Targets {
113 113
 				if target.TargetId == course.CourseId {

+ 1
- 0
service/customer/customer.go Прегледај датотеку

@@ -74,6 +74,7 @@ func (s *CustomerServ) GetCustUserByOpenID(openid string) (*customer.CustWithWX,
74 74
 			return nil, err
75 75
 		}
76 76
 		cust.BelongCaseId = caseinfo.CaseId
77
+		cust.BelongCaseStatus = caseinfo.Status
77 78
 	}
78 79
 
79 80
 	return cust, nil

+ 10
- 0
service/goods/orders.go Прегледај датотеку

@@ -545,3 +545,13 @@ func (s *GoodsServ) CancelMake(id string) error {
545 545
 	err := s.dao.UpdateOrdersMake(orders)
546 546
 	return err
547 547
 }
548
+
549
+// UpdateOrdersIntimidate 更新订单打单
550
+func (s *GoodsServ) UpdateOrdersIntimidate(id string) error {
551
+	err := s.dao.UpdateOrdersIntimidate(id)
552
+	if err != nil {
553
+		utils.LogError("更新失败:", err)
554
+		return err
555
+	}
556
+	return nil
557
+}

+ 7
- 1
service/statistics/goods.go Прегледај датотеку

@@ -92,6 +92,12 @@ func (s *StatisticsServ) GetGoodsOrdersStatisticsExcel(status, usertype, caseids
92 92
 		utils.LogError("获取商品订单统计数据失败: " + err.Error())
93 93
 		return nil, errors.New("获取商品订单统计数据失败")
94 94
 	}
95
-
95
+	for inx, item := range all {
96
+		details, err := s.dao.GetGoodsOrderDetailByOrderId(item.OrdersId)
97
+		if err != nil {
98
+			return nil, err
99
+		}
100
+		all[inx].Details = details
101
+	}
96 102
 	return all, nil
97 103
 }

+ 1
- 1
service/verify/verify.go Прегледај датотеку

@@ -86,7 +86,7 @@ func (s *VerifyServ) GetCustomerCourseDetailByTel(tel, caseids string, page, pag
86 86
 		return nil, errors.New("获取课程列表失败")
87 87
 	}
88 88
 	if len(customerDetail) == 0 {
89
-		return nil, errors.New("今日无可核销课程")
89
+		return nil, nil
90 90
 	}
91 91
 	customerID := customerDetail[0].CustomerId
92 92
 	total, err := s.dao.GetCustomerCourseListByTelCount(tel, caseids)