|
@@ -2003,35 +2003,18 @@ func UploadPay(context *admin.Context) (interface{}, error) {
|
|
|
|
|
|
func OpenInvoice(context *admin.Context) (interface{}, error) {
|
|
func OpenInvoice(context *admin.Context) (interface{}, error) {
|
|
param := new(struct {
|
|
param := new(struct {
|
|
- OrderCode string `form:"orderCode"`
|
|
|
|
- InvoiceType string `form:"invoiceType"`
|
|
|
|
- UserId string `form:"userId"`
|
|
|
|
|
|
+ OrderCode string `form:"orderCode"`
|
|
})
|
|
})
|
|
err := context.Form(param)
|
|
err := context.Form(param)
|
|
if err != nil {
|
|
if err != nil {
|
|
return nil, err
|
|
return nil, err
|
|
}
|
|
}
|
|
errs := ""
|
|
errs := ""
|
|
- if param.InvoiceType != "" {
|
|
|
|
- operator := context.User.Username
|
|
|
|
- operable_time := qutil.NowFormat(qutil.Date_Full_Layout)
|
|
|
|
|
|
+ if param.OrderCode != "" {
|
|
status := util.JysqlDB.Update("dataexport_order", map[string]interface{}{"order_code": param.OrderCode}, map[string]interface{}{
|
|
status := util.JysqlDB.Update("dataexport_order", map[string]interface{}{"order_code": param.OrderCode}, map[string]interface{}{
|
|
"applybill_status": 2,
|
|
"applybill_status": 2,
|
|
})
|
|
})
|
|
- if status {
|
|
|
|
- insert := map[string]interface{}{
|
|
|
|
- "invoice_type": param.InvoiceType,
|
|
|
|
- "operator": operator,
|
|
|
|
- "operable_time": operable_time,
|
|
|
|
- "user_id": param.UserId,
|
|
|
|
- "order_code": param.OrderCode,
|
|
|
|
- "create_time": time.Now().Unix(),
|
|
|
|
- }
|
|
|
|
- orderId := util.JysqlDB.Insert("invoice", insert)
|
|
|
|
- if orderId < 0 {
|
|
|
|
- errs = "发票信息保存失败"
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
|
|
+ if !status {
|
|
errs = "订单修改失败"
|
|
errs = "订单修改失败"
|
|
}
|
|
}
|
|
}
|
|
}
|