新增未完成数量统计
This commit is contained in:
parent
b70998ef5b
commit
de8b3e250b
@ -354,60 +354,56 @@ func CheckInvitedCode(req *artistInfoUser.CheckInvitedCodeRequest) (rep *artistI
|
|||||||
func UnFinishList(req *artistInfoUser.UnFinishListRequest) (rep *artistInfoUser.UnFinishListRespond, err error) {
|
func UnFinishList(req *artistInfoUser.UnFinishListRequest) (rep *artistInfoUser.UnFinishListRespond, err error) {
|
||||||
rep = &artistInfoUser.UnFinishListRespond{}
|
rep = &artistInfoUser.UnFinishListRespond{}
|
||||||
var user model.User
|
var user model.User
|
||||||
if err := db.DB.Where("id = ? ", req.Id).First(&user).Error; err != nil {
|
if err := db.DB.Where("mgmt_acc_id = ? ", req.AccId).First(&user).Error; err != nil {
|
||||||
zap.L().Error("get user info err", zap.Error(err))
|
zap.L().Error("get user info err", zap.Error(err))
|
||||||
err = errors.New(m.ERROR_SELECT)
|
err = errors.New(m.ERROR_SELECT)
|
||||||
return nil, err
|
return nil, err
|
||||||
|
}
|
||||||
|
var accountStatusList int64
|
||||||
|
if user.IsRealName == 0 {
|
||||||
|
accountStatusList = 1
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if user.MgmtArtistUid == "" {
|
||||||
|
accountStatusList = 2
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo
|
//艺术家补充信息完成度统计
|
||||||
//var realName model.RealName
|
//var unfinishArtistSupplementCount int64
|
||||||
//if err := db.DB.Where("id = ? ", user.RealNameID).First(&realName).Error; err != nil {
|
//if err = db.DB.Model(model.ArtshowArtistSupplement{}).Where("status = 2 AND artist_uid = ? AND audit_status in (3,5)", user.MgmtArtistUid).Count(&unfinishArtistSupplementCount).Error; err != nil {
|
||||||
// zap.L().Error("get user info err", zap.Error(err))
|
// zap.L().Error("艺术家补充信息统计错误")
|
||||||
// err = errors.New(m.ERROR_SELECT)
|
|
||||||
// return nil, err
|
// return nil, err
|
||||||
//}
|
//}
|
||||||
//var contract model.Contract
|
var viewData = struct {
|
||||||
//var contractCount int64
|
UnfinishedArtworkBaseCount int64 `gorm:"column:unfinished_artwork_base_count;comment:未完成的画作基本信息数量"`
|
||||||
//if err := db.DB.Model(&contract).Where("state = ? and (user_id = ? or card_id = ?) and (type =1 or type = 2 or type = 3)", "1", user.ID, realName.IDNum).Count(&contractCount).Error; err != nil {
|
UnfinishedArtworkSupplementCount int64 `gorm:"column:unfinished_artwork_supplement_count;comment:未完成的画作补充信息数量"`
|
||||||
// err = errors.New(m.ERROR_SELECT)
|
UnfinishedArtistSupplementCount int64 `gorm:"column:unfinished_artist_supplement_count;comment:未完成的画家补充信息数量"`
|
||||||
// return nil, err
|
UnfinishedArtistVideoRecordCount int64 `gorm:"column:unfinished_artist_video_record_count;comment:未完成的画展视频统计"`
|
||||||
//}
|
UnfinishedArtistIndexCount int64 `gorm:"column:unfinished_artist_index_count;comment:未完成的画家指数"`
|
||||||
//rep.ContractList = contractCount
|
}{}
|
||||||
//var accountStateCount int64
|
//todo 目前缺少合同列表
|
||||||
//fmt.Println(realName.IDNum)
|
var sql = fmt.Sprintf(`
|
||||||
//if err := db.DB.Model(&contract).Where("state = ? and (user_id = ? or card_id = ?) and type = 4", "1", user.ID, realName.IDNum).Count(&accountStateCount).Error; err != nil {
|
SELECT
|
||||||
// zap.L().Error("get user info err", zap.Error(err))
|
COUNT(1) unfinished_artwork_base_count ,
|
||||||
// err = errors.New(m.ERROR_SELECT)
|
(SELECT COUNT(1) FROM artwork_lock_record WHERE artist_uid = ? AND deleted_at = 0 AND STATUS =2 AND supplement_audit_status IN (3,5) )unfinished_artwork_supplement_count,
|
||||||
// return nil, err
|
(SELECT COUNT(1) FROM artshow_artist_supplement WHERE artist_uid = ? AND deleted_at = 0 AND STATUS =2 AND audit_status IN (3,5) ) unfinished_artist_supplement_count,
|
||||||
//}
|
(SELECT COUNT(1) FROM artshow_video_record WHERE artist_uid = ? AND deleted_at = 0 AND STATUS =2 AND audit_status IN (3,5)) unfinished_artist_video_record_count,
|
||||||
//rep.AccountStateList = accountStateCount
|
(SELECT COUNT(1) FROM artshow_artist_index WHERE artist_uid = ? AND deleted_at = 0 AND STATUS =2 AND audit_status IN (3,5)) unfinished_artist_index_count
|
||||||
//var supplyInfo model.SupplyInfo
|
FROM
|
||||||
//var supplyInfoCount int64
|
artwork_lock_record
|
||||||
//if err := db.DB.Model(&supplyInfo).Where("types = ? and user_id = ? ", "1", user.ID).Count(&supplyInfoCount).Error; err != nil {
|
WHERE artist_uid = ? AND STATUS = 2 AND base_audit_status IN (1,3,5)
|
||||||
// zap.L().Error("get user info err", zap.Error(err))
|
`)
|
||||||
// err = errors.New(m.ERROR_SELECT)
|
err = db.DB.Raw(sql, user.MgmtArtistUid, user.MgmtArtistUid, user.MgmtArtistUid, user.MgmtArtistUid, user.MgmtArtistUid).Scan(&viewData).Error
|
||||||
// return nil, err
|
if err != nil {
|
||||||
//}
|
return nil, err
|
||||||
//rep.SupplyInfoList += supplyInfoCount
|
}
|
||||||
//var exhVideo model.ExhVideo
|
|
||||||
//var exhVideoCount int64
|
|
||||||
//if err := db.DB.Model(&exhVideo).Where("types = ? and user_id = ? ", "1", user.ID).Count(&exhVideoCount).Error; err != nil {
|
|
||||||
// zap.L().Error("get user info err", zap.Error(err))
|
|
||||||
// err = errors.New(m.ERROR_SELECT)
|
|
||||||
// return nil, err
|
|
||||||
//}
|
|
||||||
//rep.SupplyInfoList += exhVideoCount
|
|
||||||
//var exhExam model.ExhExam
|
|
||||||
//var exhExamCount int64
|
|
||||||
//if err := db.DB.Model(&exhExam).Where("types = ? and user_id = ? ", "1", user.ID).Count(&exhExamCount).Error; err != nil {
|
|
||||||
// zap.L().Error("get user info err", zap.Error(err))
|
|
||||||
// err = errors.New(m.ERROR_SELECT)
|
|
||||||
// return nil, err
|
|
||||||
//}
|
|
||||||
//rep.SupplyInfoList += exhExamCount
|
|
||||||
|
|
||||||
|
rep = &artistInfoUser.UnFinishListRespond{
|
||||||
|
ContractList: 0, //todo
|
||||||
|
SupplyInfoList: viewData.UnfinishedArtworkBaseCount + viewData.UnfinishedArtworkSupplementCount + viewData.UnfinishedArtistIndexCount + viewData.UnfinishedArtistSupplementCount,
|
||||||
|
AccountStateList: accountStatusList,
|
||||||
|
}
|
||||||
return rep, nil
|
return rep, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,17 +3,17 @@ mode = dev #正式prod #测试dev
|
|||||||
|
|
||||||
[mysql]
|
[mysql]
|
||||||
Db = mysql
|
Db = mysql
|
||||||
DbHost = 172.16.100.99 #214
|
DbHost = 127.0.0.1
|
||||||
DbPort = 9007
|
DbPort = 3306
|
||||||
DbUser = artuser
|
DbUser = root
|
||||||
DbPassWord = "C250PflXIWv2SQm8"
|
DbPassWord = 123456
|
||||||
DbName = artistmgmtDev
|
DbName = artistmgmttest
|
||||||
|
|
||||||
[redis]
|
[redis]
|
||||||
RedisDB = 3
|
RedisDB = 2
|
||||||
RedisAddr = 172.16.100.99:9008
|
RedisAddr = 127.0.0.1:6379
|
||||||
RedisPW = "nDCTrfTtBu3Pw"
|
#RedisPW = "nDCTrfTtBu3Pw"
|
||||||
RedisDBNAme =
|
#RedisDBNAme =
|
||||||
|
|
||||||
[chain]
|
[chain]
|
||||||
IP=127.0.0.1:37101
|
IP=127.0.0.1:37101
|
||||||
|
@ -8,10 +8,10 @@ dubbo:
|
|||||||
demoZK:
|
demoZK:
|
||||||
protocol: zookeeper
|
protocol: zookeeper
|
||||||
timeout: 120s
|
timeout: 120s
|
||||||
# address: 127.0.0.1:2181
|
address: 127.0.0.1:2181
|
||||||
# address: 121.229.45.214:9004
|
# address: 121.229.45.214:9004
|
||||||
# address: 114.218.158.24:2181
|
# address: 114.218.158.24:2181
|
||||||
address: 172.16.100.93:2181
|
# address: zookeeper:2181
|
||||||
protocols:
|
protocols:
|
||||||
triple: #triple
|
triple: #triple
|
||||||
name: tri
|
name: tri
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -92,7 +92,7 @@ message CheckInvitedCodeRespond {
|
|||||||
|
|
||||||
}
|
}
|
||||||
message UnFinishListRequest {
|
message UnFinishListRequest {
|
||||||
int64 id = 1;
|
int64 accId = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message UnFinishListRespond {
|
message UnFinishListRespond {
|
||||||
|
Loading…
Reference in New Issue
Block a user