Browse Source

no message

xingzai 7 months ago
parent
commit
90ebaa9f84

+ 1 - 0
models/article_and_yanxuan_record.go

@@ -20,6 +20,7 @@ type CygxArticleAndYanxuanRecord struct {
 	SellerName       string    `description:"所属销售"`
 	StopTime         int       `description:"停留时间"`
 	RegisterPlatform int       `description:"来源 1小程序,2:网页"`
+	PermissionCode   int       // 权限状态,1:有权限,0:无权限
 }
 
 // 批量添加

+ 3 - 0
models/cygx_yanxuan_special_record.go

@@ -19,6 +19,7 @@ type CygxYanxuanSpecialRecord struct {
 	RegisterPlatform           int       // 来源 1小程序,2:网页
 	YanxuanSpecialId           int       // cygx_yanxuan_special 表主键ID
 	StopTime                   int       // 停留时间
+	PermissionCode             int       // 权限状态,1:有权限,0:无权限
 }
 
 type CygxYanxuanSpecialRecordResp struct {
@@ -35,6 +36,7 @@ type CygxYanxuanSpecialRecordResp struct {
 	RegisterPlatform           int       // 来源 1小程序,2:网页
 	YanxuanSpecialId           int       // cygx_yanxuan_special 表主键ID
 	StopTime                   int       // 停留时间
+	PermissionCode             int       // 权限状态,1:有权限,0:无权限
 }
 
 func AddCygxYanxuanSpecialRecord(item *CygxYanxuanSpecialRecord) (lastId int64, err error) {
@@ -91,6 +93,7 @@ type CygxYanxuanSpecialRecordLog struct {
 	RegisterPlatform           int       // 来源 1小程序,2:网页
 	YanxuanSpecialId           int       // cygx_yanxuan_special 表主键ID
 	StopTime                   int       // 停留时间
+	PermissionCode             int       // 权限状态,1:有权限,0:无权限
 }
 
 func AddCygxYanxuanSpecialRecordLog(item *CygxYanxuanSpecialRecordLog) (lastId int64, err error) {

+ 1 - 0
services/article_history.go

@@ -271,6 +271,7 @@ func AddAllArticleAndYanxuanHistory(cont context.Context) (err error) {
 				item.CreateTime = v.CreateTime
 				item.ModifyTime = v.ModifyTime
 				item.StopTime = v.StopTime
+				item.PermissionCode = v.PermissionCode
 				item.RegisterPlatform = v.RegisterPlatform
 				items = append(items, item)
 			}

+ 5 - 2
services/cygx_yanxuan_special_company.go

@@ -82,8 +82,9 @@ func AddSpecialRecord(user *models.WxUserItem, specialId, stopTime int) (err err
 		return
 	}
 
-	if !havePower {
-		return
+	var permissionCode int
+	if havePower {
+		permissionCode = 1
 	}
 	var sellerName string
 	//获取销售信息
@@ -116,6 +117,7 @@ func AddSpecialRecord(user *models.WxUserItem, specialId, stopTime int) (err err
 		item.RegisterPlatform = utils.REGISTER_PLATFORM
 		item.YanxuanSpecialId = specialId
 		item.StopTime = stopTime
+		item.PermissionCode = permissionCode
 		_, e = models.AddCygxYanxuanSpecialRecord(item) // 添加历史记录
 		if e != nil {
 			err = errors.New("AddCygxYanxuanSpecialRecord, Err: " + e.Error())
@@ -169,6 +171,7 @@ func AddSpecialRecord(user *models.WxUserItem, specialId, stopTime int) (err err
 	itemLog.RegisterPlatform = utils.REGISTER_PLATFORM
 	itemLog.YanxuanSpecialId = specialId
 	itemLog.StopTime = stopTime
+	itemLog.PermissionCode = permissionCode
 	_, e = models.AddCygxYanxuanSpecialRecordLog(itemLog) // 添加历史记录
 	if e != nil {
 		err = errors.New("AddCygxYanxuanSpecialRecordLog, Err: " + e.Error())