瀏覽代碼

后端: 数量判断

baichengfei 4 年之前
父節點
當前提交
b302df19b5
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      src/dashoo.cn/backend/api/controllers/oilcontract/contract.go

+ 5 - 2
src/dashoo.cn/backend/api/controllers/oilcontract/contract.go

@@ -721,7 +721,7 @@ func (this *OilContractController) ImportUpdate() {
 
 	if Column == "SecondUnit" {
 		var org organize.Base_Organize
-		svc.GetEntityByWhere("Base_Organize", "Id = " + Value, &org)
+		svc.GetEntityByWhere("Base_Organize", "Id = "+Value, &org)
 		if Id != "" {
 			where += " and Id = " + Id + " and ImportStatus = 0 and ImportSecondUnit = '" + Class + "'"
 			sql = "update OilContract set SecondUnitName = '" + org.Fullname + "',SupplierName = '" + supp.SupplierName + "', " + Column + " = " + Value + " where " + where
@@ -1179,7 +1179,10 @@ func (this *OilContractController) GetNeedEvaList() {
 
 	var dataInfo DataInfo
 	dataInfo.Items = list
-	dataInfo.CurrentItemCount = int64(len(list))
+	dataInfo.CurrentItemCount = 0
+	if list != nil {
+		dataInfo.CurrentItemCount = int64(len(list))
+	}
 	this.Data["json"] = &dataInfo
 	this.ServeJSON()
 }