Commit 81abd60d by wang

^

parent ecfc44e0
Showing with 9 additions and 1 deletions
package service package service
import ( import (
"encoding/json"
"fmt" "fmt"
"go_supplier_task/pkg/common" "go_supplier_task/pkg/common"
syncLog "go_supplier_task/pkg/logger/sync" syncLog "go_supplier_task/pkg/logger/sync"
...@@ -132,12 +133,19 @@ func (this *ServiceSupplier) onlyOpenHandle(groupName string,PoolSupplierEntity ...@@ -132,12 +133,19 @@ func (this *ServiceSupplier) onlyOpenHandle(groupName string,PoolSupplierEntity
*/ */
func (this *ServiceSupplier) updateSupplier(supplierEntity PoolSupplierEntity,cols ...string) { func (this *ServiceSupplier) updateSupplier(supplierEntity PoolSupplierEntity,cols ...string) {
if(len(cols)<=0){ /*if(len(cols)<=0){
cols=[]string{ cols=[]string{
"is_type","updated","status","supplier_name", "is_type","updated","status","supplier_name",
} }
} }
fmt.Println(len(cols))
panic("瞧瞧====================================================================")*/
cols=[]string{
"is_type","updated","status","supplier_name",
}
dbSpu:= mysql.Conn("supp") //spu实例化链接 dbSpu:= mysql.Conn("supp") //spu实例化链接
bytes,_:=json.Marshal(supplierEntity)
fmt.Printf(string(bytes))
_,err:= dbSpu.Table("lie_supplier_channel").Where("supplier_id=?",supplierEntity.SupplierId).Cols(cols...).Update(supplierEntity) _,err:= dbSpu.Table("lie_supplier_channel").Where("supplier_id=?",supplierEntity.SupplierId).Cols(cols...).Update(supplierEntity)
if(err!=nil){ if(err!=nil){
errMsg:=fmt.Sprintf("修改失败:错误:%s;数据:%s",err.Error(),fmt.Sprintln(supplierEntity)) errMsg:=fmt.Sprintf("修改失败:错误:%s;数据:%s",err.Error(),fmt.Sprintln(supplierEntity))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment