Xingyu Xian 1 天之前
父節點
當前提交
445dc5810d

+ 13 - 12
db/local_life_task.go

@@ -145,31 +145,32 @@ func ChangeLocalTaskStatus(ctx context.Context, taskIds []string, supplierStatus
 }
 
 // GetSLocalTaskList 服务商本地生活子任务账单列表
-func GetSLocalTaskList(ctx context.Context, sLocalId int, talentId string, pageSize, pageNum int32) ([]*gorm_model.YoungeeLocalTaskInfo, int64, error) {
+func GetSLocalTaskList(ctx context.Context, sLocalId int, condition string, pageSize, pageNum int32) ([]*gorm_model.YoungeeLocalTaskInfo, int64, error) {
 	db := GetReadDB(ctx)
-	whereCondition := gorm_model.YoungeeLocalTaskInfo{
-		SLocalID: sLocalId,
-		TalentID: talentId,
+
+	// 基础查询条件 - 必须有s_local_id
+	db = db.Debug().Model(gorm_model.YoungeeLocalTaskInfo{}).Where("s_local_id = ?", sLocalId)
+
+	// 如果talentId不为空,则添加为查询条件
+	if condition != "" {
+		db = db.Where("talent_id = ?", condition)
 	}
-	// 查询task表信息
-	db = db.Debug().Model(gorm_model.YoungeeLocalTaskInfo{}).Where(whereCondition)
 
 	var taskInfos []*gorm_model.YoungeeLocalTaskInfo
-	db = db.Model(gorm_model.YoungeeLocalTaskInfo{})
+
 	// 查询总数
 	var totalTask int64
 	if err := db.Count(&totalTask).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		logrus.WithContext(ctx).Errorf("[GetSLocalTaskList] error query mysql total, err:%+v", err)
 		return nil, 0, err
 	}
-	db.Order("task_id").Find(&taskInfos)
 
 	// 查询该页数据
 	limit := pageSize
-	offset := pageSize * pageNum // assert pageNum start with 0
-	err := db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
+	offset := pageSize * pageNum // 保持pageNum从0开始
+	err := db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Find(&taskInfos).Error
 	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		logrus.WithContext(ctx).Errorf("[GetSLocalTaskList] error query mysql data, err:%+v", err)
 		return nil, 0, err
 	}
 

+ 22 - 10
db/s_local_life.go

@@ -238,27 +238,39 @@ func UpdateSLocal(ctx context.Context, sLocalInfo *gorm_model.YounggeeSLocalLife
 	return nil
 }
 
-func GetFullSLocalBillList(ctx context.Context, pageSize, pageNum int32, supplierId int) ([]*gorm_model.YounggeeSLocalLifeInfo, int64, error) {
-	db := GetReadDB(ctx)
+func GetFullSLocalBillList(ctx context.Context, pageSize, pageNum int32, supplierId int, localType int, taskStatus int, LocalPlatform int) ([]*gorm_model.YounggeeSLocalLifeInfo, int64, error) {
+	// 基础查询:必须按 supplier_id 过滤
+	db := GetReadDB(ctx).Model(gorm_model.YounggeeSLocalLifeInfo{}).
+		Where("supplier_id = ? and local_type = ?", supplierId, localType)
 
-	// 根据带货任务状态过滤
-	db = db.Debug().Model(gorm_model.YounggeeSLocalLifeInfo{}).Where("task_status = 4 and local_type = 1")
+	// 可选:按 taskStatus 过滤(非零时生效)
+	if taskStatus != 0 {
+		db = db.Where("task_status = ?", taskStatus)
+	}
+
+	// 可选:按 LocalPlatform 过滤(非零时生效)
+	if LocalPlatform != 0 {
+		db = db.Where("local_platform = ?", LocalPlatform)
+	}
 
 	// 查询总数
 	var total int64
-	var fullLocals []*gorm_model.YounggeeSLocalLifeInfo
 	if err := db.Count(&total).Error; err != nil {
-		logrus.WithContext(ctx).Errorf("[GetFullProjectList] error query mysql total, err:%+v", err)
+		logrus.WithContext(ctx).Errorf("[GetFullSLocalBillList] count error: %+v", err)
 		return nil, 0, err
 	}
 
-	// 查询该页数据
+	var fullLocals []*gorm_model.YounggeeSLocalLifeInfo
 	limit := pageSize
-	offset := pageSize * pageNum // assert pageNum start with 0
-	err := db.Order("s_local_id desc").Limit(int(limit)).Offset(int(offset)).Find(&fullLocals).Error
+	offset := pageSize * (pageNum)
+	err := db.Order("s_local_id desc").
+		Limit(int(limit)).
+		Offset(int(offset)).
+		Find(&fullLocals).Error
 	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetFullProjectList] error query mysql total, err:%+v", err)
+		logrus.WithContext(ctx).Errorf("[GetFullSLocalBillList] query error: %+v", err)
 		return nil, 0, err
 	}
+
 	return fullLocals, total, nil
 }

+ 32 - 20
db/s_project.go

@@ -176,27 +176,37 @@ func UpdateSProjectStrategyStatus(ctx context.Context, req *http_model.SpecialAd
 	return nil
 }
 
-// GetFullSProjectBillList 查询公开种草任务账单列表
-func GetFullSProjectBillList(ctx context.Context, supplierId int, ProjectPlatform int, projectStatus int, pageSize, pageNum int32) ([]*gorm_model.SProjectInfo, int64, error) {
-	db := GetReadDB(ctx)
+// GetFullSProjectBillList 服务商种草任务账单
+func GetFullSProjectBillList(ctx context.Context, supplierId int, projectType int, ProjectPlatform int, projectStatus int, pageSize, pageNum int32) ([]*gorm_model.SProjectInfo, int64, error) {
+	db := GetReadDB(ctx).Model(gorm_model.SProjectInfo{}).Where("supplier_id = ? and project_type = ?", supplierId, projectType)
 
-	// 1. 根据服务商id过滤
-	db = db.Debug().Model(gorm_model.SProjectInfo{}).Where("supplier_id = ? and project_status = ? and project_platform = ?", supplierId, projectStatus, ProjectPlatform)
+	// 仅当 ProjectPlatform 非零时才过滤
+	if ProjectPlatform != 0 {
+		db = db.Where("project_platform = ?", ProjectPlatform)
+	}
+
+	// 仅当 projectStatus 非零时才过滤
+	if projectStatus != 0 {
+		db = db.Where("project_status = ?", projectStatus)
+	}
 
-	// 2. 确定查询总数和返回当前页数据
+	// 查询总数
 	var total int64
-	var SProjects []*gorm_model.SProjectInfo
 	if err := db.Count(&total).Error; err != nil {
 		logrus.WithContext(ctx).Errorf("[GetFullProjectList] error query mysql total, err:%+v", err)
 		return nil, 0, err
 	}
+
+	// 查询当前页数据
+	var SProjects []*gorm_model.SProjectInfo
 	limit := pageSize
-	offset := pageSize * pageNum // assert pageNum start with 0
+	offset := pageSize * pageNum // 假设 pageNum 从 0 开始
 	err := db.Order("s_project_id desc").Limit(int(limit)).Offset(int(offset)).Find(&SProjects).Error
 	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetFullProjectList] error query mysql total, err:%+v", err)
+		logrus.WithContext(ctx).Errorf("[GetFullProjectList] error query mysql, err:%+v", err)
 		return nil, 0, err
 	}
+
 	return SProjects, total, nil
 }
 
@@ -215,31 +225,33 @@ func FindSProjectByProjectIdAndSupplierId(ctx context.Context, projectId string,
 	return total, nil
 }
 
-func GetSProjectTaskList(ctx context.Context, sProjectId int, talentId string, pageSize, pageNum int32) ([]*gorm_model.YoungeeTaskInfo, int64, error) {
+func GetSProjectTaskList(ctx context.Context, sProjectId int, condition string, pageSize, pageNum int32) ([]*gorm_model.YoungeeTaskInfo, int64, error) {
 	db := GetReadDB(ctx)
-	whereCondition := gorm_model.YoungeeTaskInfo{
-		SProjectId: sProjectId,
-		TalentID:   talentId,
+
+	// 基础查询条件 - 必须有s_project_id
+	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where("s_project_id = ?", sProjectId)
+
+	// 如果condition不为空
+	if condition != "" {
+		// db = db.Where("talent_id = ? OR talent_name LIKE ?", condition, "%"+condition+"%")
+		db = db.Where("talent_id = ?", condition)
 	}
-	// 查询task表信息
-	db = db.Debug().Model(gorm_model.YoungeeTaskInfo{}).Where(whereCondition)
 
 	var taskInfos []*gorm_model.YoungeeTaskInfo
-	db = db.Model(gorm_model.YoungeeTaskInfo{})
+
 	// 查询总数
 	var totalTask int64
 	if err := db.Count(&totalTask).Error; err != nil {
 		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
 		return nil, 0, err
 	}
-	db.Order("task_id").Find(&taskInfos)
 
 	// 查询该页数据
 	limit := pageSize
-	offset := pageSize * pageNum // assert pageNum start with 0
-	err := db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
+	offset := pageSize * (pageNum - 1) // 假设pageNum从1开始
+	err := db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Find(&taskInfos).Error
 	if err != nil {
-		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
+		logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql data, err:%+v", err)
 		return nil, 0, err
 	}
 

+ 7 - 1
handler/create_supplier_invoice.go

@@ -35,11 +35,14 @@ func (h *CreateSupplierInvoiceHandler) getResponse() interface{} {
 	return h.resp
 }
 func (h *CreateSupplierInvoiceHandler) run() {
+
 	// 1. 合并收入回票
 	err := service.Supplier.CreateSupplierInvoice(h.ctx, h.req)
 	if err != nil {
 		h.resp.Data = err.Error()
 		h.resp.Message = "合并失败"
+		h.resp.Status = 40000
+		return
 	}
 
 	// 2. 修改收入状态
@@ -47,8 +50,11 @@ func (h *CreateSupplierInvoiceHandler) run() {
 	if incomeErr != nil {
 		h.resp.Data = incomeErr.Error()
 		h.resp.Message = "修改收入状态失败"
+		h.resp.Status = 40000
+		return
 	}
-	h.resp.Message = "合并修改成功"
+	h.resp.Message = "ok"
+	h.resp.Status = 20000
 }
 
 func (h *CreateSupplierInvoiceHandler) checkParam() error {

+ 3 - 0
handler/full_s_local_bill_list.go

@@ -38,9 +38,12 @@ func (h *FullSLocalBillListHandler) run() {
 	data, err := service.SLocalLife.GetFullSLocalBillList(h.ctx, h.req)
 	if err != nil {
 		h.resp.Message = err.Error()
+		h.resp.Status = 40000
+		return
 	}
 	h.resp.Data = data
 	h.resp.Message = "成功查询"
+	h.resp.Status = 20000
 }
 
 func (h *FullSLocalBillListHandler) checkParam() error {

+ 3 - 0
handler/full_s_local_task_bill_list.go

@@ -38,9 +38,12 @@ func (h *FullSLocalBillTaskListHandler) run() {
 	data, err := service.SLocalLife.FullSLocalTaskBillList(h.ctx, h.req)
 	if err != nil {
 		h.resp.Message = err.Error()
+		h.resp.Status = 40000
+		return
 	}
 	h.resp.Data = data
 	h.resp.Message = "成功查询"
+	h.resp.Status = 20000
 }
 
 func (h *FullSLocalBillTaskListHandler) checkParam() error {

+ 4 - 1
handler/full_s_project_bill_list.go

@@ -38,9 +38,12 @@ func (h *FullSProjectBillListHandler) run() {
 	data, err := service.SProject.FullSProjectBillList(h.ctx, h.req)
 	if err != nil {
 		h.resp.Message = err.Error()
+		h.resp.Status = 40000
+		return
 	}
 	h.resp.Data = data
-	h.resp.Message = "成功查询"
+	h.resp.Message = "ok"
+	h.resp.Status = 20000
 }
 
 func (h *FullSProjectBillListHandler) checkParam() error {

+ 4 - 1
handler/full_s_project_task_bill_list.go

@@ -38,9 +38,12 @@ func (h *FullSProjectBillTaskListHandler) run() {
 	data, err := service.SProject.FullSProjectTaskBillList(h.ctx, h.req)
 	if err != nil {
 		h.resp.Message = err.Error()
+		h.resp.Status = 40000
+		return
 	}
 	h.resp.Data = data
-	h.resp.Message = "成功查询"
+	h.resp.Message = "ok"
+	h.resp.Status = 20000
 }
 
 func (h *FullSProjectBillTaskListHandler) checkParam() error {

+ 5 - 2
handler/get_manage_invoice_info.go

@@ -38,10 +38,13 @@ func (h *ManageInvoiceInfoHandler) run() {
 	supplierInvoice, err := service.Supplier.GetManageInvoiceInfo(h.ctx, h.req)
 	if err != nil {
 		h.resp.Data = err
-		h.resp.Message = "查询失败"
+		h.resp.Message = err.Error()
+		h.resp.Status = 40000
+		return
 	}
 	h.resp.Data = supplierInvoice
-	h.resp.Message = "查询成功"
+	h.resp.Message = "ok"
+	h.resp.Status = 20000
 
 }
 

+ 5 - 2
handler/supplier_income_list.go

@@ -38,10 +38,13 @@ func (h *FullSProjectIncomeListHandler) run() {
 	incomeData, err := service.Supplier.GetSupplierIncomeList(h.ctx, h.req)
 	if err != nil {
 		h.resp.Data = err.Error()
-		h.resp.Message = "查询失败"
+		h.resp.Message = err.Error()
+		h.resp.Status = 40000
+		return
 	}
 	h.resp.Data = incomeData
-	h.resp.Message = "成功查询"
+	h.resp.Message = "ok"
+	h.resp.Status = 20000
 }
 
 func (h *FullSProjectIncomeListHandler) checkParam() error {

+ 2 - 1
handler/supplier_invoice_amount.go

@@ -42,7 +42,8 @@ func (h *InvoiceAmountHandler) run() {
 		return
 	}
 	h.resp.Data = amount
-	h.resp.Message = "成功添加"
+	h.resp.Status = 20000
+	h.resp.Message = "ok"
 }
 
 func (h *InvoiceAmountHandler) checkParam() error {

+ 4 - 2
handler/supplier_invoice_list.go

@@ -38,11 +38,13 @@ func (h *SupplierInvoiceListHandler) run() {
 	supplierInvoice, err := service.Supplier.GetSupplierInvoiceList(h.ctx, h.req)
 	if err != nil {
 		h.resp.Data = err
-		h.resp.Message = "查询失败"
+		h.resp.Message = err.Error()
+		h.resp.Status = 40000
+		return
 	}
 	h.resp.Data = supplierInvoice
 	h.resp.Message = "查询成功"
-
+	h.resp.Status = 20000
 }
 
 func (h *SupplierInvoiceListHandler) checkParam() error {

+ 2 - 1
handler/supplier_to_withdraw_list.go

@@ -41,7 +41,8 @@ func (h *SupplierToWithdrawListHandler) run() {
 		h.resp.Message = err.Error()
 		return
 	}
-	h.resp.Status = 50000
+	h.resp.Status = 20000
+	h.resp.Message = "ok"
 	h.resp.Data = toWithdrawList
 }
 

+ 2 - 1
handler/supplier_withdraw_list.go

@@ -41,7 +41,8 @@ func (h *SupplierWithdrawListHandler) run() {
 		h.resp.Message = err.Error()
 		return
 	}
-	h.resp.Status = 50000
+	h.resp.Status = 20000
+	h.resp.Message = "ok"
 	h.resp.Data = toWithdrawList
 }
 

+ 5 - 2
handler/update_supplier_invoice.go

@@ -38,9 +38,12 @@ func (h *UpdateSupplierInvoiceHandler) run() {
 	err := service.Supplier.UpdateSupplierInvoice(h.ctx, h.req)
 	if err != nil {
 		h.resp.Data = err.Error()
-		h.resp.Message = "更新失败"
+		h.resp.Message = err.Error()
+		h.resp.Status = 40000
+		return
 	}
-	h.resp.Message = "更新成功"
+	h.resp.Message = "ok"
+	h.resp.Status = 20000
 }
 
 func (h *UpdateSupplierInvoiceHandler) checkParam() error {

+ 1 - 0
handler/withdraw_create_payment_info.go

@@ -42,6 +42,7 @@ func (h *CreateWithdrawPaymentInfoHandler) run() {
 		return
 	}
 	h.resp.Message = "ok"
+	h.resp.Status = 20000
 }
 
 func (h *CreateWithdrawPaymentInfoHandler) checkParam() error {

+ 1 - 1
handler/withdraw_payment_info.go

@@ -42,7 +42,7 @@ func (h *WithdrawPaymentInfoHandler) run() {
 		return
 	}
 	h.resp.Data = amount
-	h.resp.Message = "成功添加"
+	h.resp.Message = "ok"
 }
 
 func (h *WithdrawPaymentInfoHandler) checkParam() error {

+ 1 - 0
handler/withdraw_update_payment_info.go

@@ -42,6 +42,7 @@ func (h *UpdateWithdrawPaymentInfoHandler) run() {
 		return
 	}
 	h.resp.Message = "ok"
+	h.resp.Status = 20000
 }
 
 func (h *UpdateWithdrawPaymentInfoHandler) checkParam() error {

+ 3 - 4
model/http_model/create_supplier_invoice.go

@@ -1,10 +1,9 @@
 package http_model
 
 type CreateSupplierInvoiceRequest struct {
-	SupplierId    int    `json:"supplier_id"`     // 服务商ID
-	IncomeIds     string `json:"income_ids"`      // 收入ID列表
-	SubAccountId  int    `json:"sub_account_id"`  // 子账号ID
-	SOperatorType int    `json:"s_operator_type"` // 操作人类型
+	SupplierId   int    `json:"supplier_id"`    // 服务商ID
+	IncomeIds    string `json:"income_ids"`     // 收入ID列表
+	SubAccountId int    `json:"sub_account_id"` // 子账号ID
 }
 
 func NewCreateSupplierInvoiceRequest() *CreateSupplierInvoiceRequest {

+ 3 - 3
model/http_model/full_s_local_bill_list.go

@@ -1,13 +1,13 @@
 package http_model
 
 type FullSLocalBillListRequest struct {
-	PageNum       int32  `json:"page_num"`
+	PageNum       int32  `json:"page"`
 	PageSize      int32  `json:"page_size"`
 	LocalPlatform int    `json:"local_platform"` // 任务平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
+	LocalType     int    `json:"local_type"`     // 本地生活类型,1公开,2定向
 	SupplierId    int    `json:"supplier_id"`    // 服务商ID
 	TaskStatus    int    `json:"task_status"`    // 任务状态
-	SLocalId      int    `json:"s_local_id"`     // 本地生活ID
-	LocalName     string `json:"local_name"`     // 任务名称
+	Condition     string `json:"condition"`      // 搜索条件
 }
 
 type FullSLocalBillData struct {

+ 5 - 4
model/http_model/full_s_local_task_bill_list.go

@@ -1,10 +1,10 @@
 package http_model
 
 type FullSLocalTaskBillListRequest struct {
-	SLocalId int    `json:"s_local_id"` // 服务商任务ID
-	TalentId string `json:"talent_id"`  // 达人ID
-	PageNum  int32  `json:"page_num"`
-	PageSize int32  `json:"page_size"`
+	SLocalId  int    `json:"s_local_id"` // 服务商任务ID
+	Condition string `json:"condition"`  // 搜索框条件
+	PageNum   int32  `json:"page"`
+	PageSize  int32  `json:"page_size"`
 }
 
 type FullSLocalTaskBillData struct {
@@ -32,6 +32,7 @@ type FullSLocalTaskBillListData struct {
 	SettleTime        string  `json:"settle_time"`         // 结算时间
 	TalentHeadUrl     string  `json:"talent_head_url"`     // 达人头像URL
 	TalentNackName    string  `json:"talent_nack_name"`    // 达人昵称
+	TalentPlatformId  string  `json:"talent_platform_id"`  // 达人第三方平台ID
 }
 
 func NewFullSLocalTaskBillRequest() *FullSLocalTaskBillListRequest {

+ 3 - 3
model/http_model/full_s_project_bill_list.go

@@ -4,9 +4,9 @@ type FullSProjectBillListRequest struct {
 	ProjectPlatform int    `json:"project_platform"` // 种草任务平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
 	SupplierId      int    `json:"supplier_id"`      // 服务商ID
 	ProjectStatus   int    `json:"project_status"`   // 种草任务状态
-	SProjectId      int    `json:"s_project_id"`     // 种草任务ID
-	ProjectName     string `json:"project_name"`     // 种草任务名称
-	PageNum         int32  `json:"page_num"`
+	ProjectType     int    `json:"project_type"`     // 任务类型,1代表公开,2代表定向
+	Condition       string `json:"condition"`        // 搜索条件
+	PageNum         int32  `json:"page"`
 	PageSize        int32  `json:"page_size"`
 }
 

+ 4 - 5
model/http_model/full_s_project_income_list.go

@@ -1,11 +1,10 @@
 package http_model
 
 type FullSProjectIncomeListRequest struct {
-	SupplierId   int   `json:"supplier_id"`     // 服务商ID
-	IncomeStatus int   `json:"income_status"`   // 收入状态
-	SProjectId   int   `json:"s_project_id"`    // 种草任务ID
-	SLocalLifeId int   `json:"s_local_life_id"` // 本地生活ID
-	PageNum      int32 `json:"page_num"`
+	SupplierId   int   `json:"supplier_id"`   // 服务商ID
+	IncomeStatus int   `json:"income_status"` // 收入状态
+	Condition    int   `json:"condition"`     // 搜索内容
+	PageNum      int32 `json:"page"`
 	PageSize     int32 `json:"page_size"`
 }
 

+ 5 - 4
model/http_model/full_s_project_task_bill_list.go

@@ -2,8 +2,8 @@ package http_model
 
 type FullSProjectTaskBillListRequest struct {
 	SProjectId int    `json:"s_project_id"` // 种草任务ID
-	TalentId   string `json:"talent_id"`    // 达人ID
-	PageNum    int32  `json:"page_num"`
+	Condition  string `json:"condition"`    // 搜索框条件
+	PageNum    int32  `json:"page"`
 	PageSize   int32  `json:"page_size"`
 }
 
@@ -27,11 +27,12 @@ type FullSProjectTaskBillListData struct {
 	ServiceCharge     float64 `json:"service_charge"`      // 服务费
 	DraftFee          float64 `json:"draft_fee"`           // 达人稿费
 	DelayRate         int     `json:"delay_rate"`          // 违约扣款比例
-	RealServiceCharge float64 `json:"real_service_charge"` // 实际服务费
-	SettleAmount      float64 `json:"settle_amount"`       // 达人实际所得
+	RealServiceCharge float64 `json:"real_service_charge"` // 服务费结算
+	SettleAmount      float64 `json:"settle_amount"`       // 达人稿费结算
 	SettleTime        string  `json:"settle_time"`         // 结算时间
 	TalentHeadUrl     string  `json:"talent_head_url"`     // 达人头像URL
 	TalentNackName    string  `json:"talent_nack_name"`    // 达人昵称
+	TalentPlatformId  string  `json:"talent_platform_id"`  // 达人第三方平台ID
 }
 
 func NewFullSProjectTaskBillRequest() *FullSProjectTaskBillListRequest {

+ 10 - 8
model/http_model/supplier_amount_bill_list.go

@@ -60,19 +60,21 @@ type SupplierAmountBillListData struct {
 	Name                string  `json:"name"`                  // local_name 或 project_name
 	Type                int     `json:"type"`                  // 任务类型 1种草,2带货,3本地生活
 	Platform            int64   `json:"platform"`              // local_platform 或 project_platform
-	ApplyNum            int     `json:"apply_num"`             //
-	RecruitNum          int     `json:"recruit_num"`           //
-	SettleNum           int     `json:"settle_num"`            //
-	EnterpriseId        string  `json:"enterprise_id"`         //
-	SupplierId          int     `json:"supplier_id"`           //
-	ServiceChargeActual float64 `json:"service_charge_actual"` // 服务商实际可赚服务费
-	ServiceChargeSettle float64 `json:"service_charge_settle"` // 已结算服务费
-	CreateTime          string  `json:"create_time"`           // 创建时间
+	ApplyNum            int     `json:"apply_num"`             // 报名人数
+	RecruitNum          int     `json:"recruit_num"`           // 合作人数
+	SettleNum           int     `json:"settle_num"`            // 结算人数
+	UnSettleNum         int     `json:"un_settle_num"`         // 未结算人数
+	EnterpriseId        string  `json:"enterprise_id"`         // 商家ID
+	SupplierId          int     `json:"supplier_id"`           // 服务商ID
+	ServiceChargeActual float64 `json:"service_charge_actual"` // 服务费总额
+	ServiceChargeSettle float64 `json:"service_charge_settle"` // 服务费已结算
+	CreateTime          string  `json:"create_time"`           // 任务执行开始时间
 	FinishTime          string  `json:"finish_time"`           // 结案时间
 	MainPhotoUrl        string  `json:"main_photo_url"`        // 主图url
 	Price               float64 `json:"price"`                 // 价格
 	Location            string  `json:"location"`              // 地址
 	ProductId           int     `json:"product_id"`            // 商品或门店ID
+	AddToListOperator   string  `json:"add_to_list_operator"`  // 添加商单操作人
 }
 
 func SupplierAmountBillRequest() *SupplierAmountBillListRequest {

+ 1 - 1
model/http_model/supplier_invoice_list.go

@@ -5,7 +5,7 @@ import "time"
 type SupplierInvoiceListRequest struct {
 	SupplierId    int   `json:"supplier_id"`    // 服务商ID
 	InvoiceStatus int   `json:"invoice_status"` // 发票状态
-	PageNum       int32 `json:"page_num"`
+	PageNum       int32 `json:"page"`
 	PageSize      int32 `json:"page_size"`
 }
 

+ 1 - 1
model/http_model/supplier_to_withdraw_list.go

@@ -6,7 +6,7 @@ import (
 
 type SupplierToWithdrawListRequest struct {
 	SupplierId int   `json:"supplier_id"` // 服务商ID
-	PageNum    int32 `json:"page_num"`
+	PageNum    int32 `json:"page"`
 	PageSize   int32 `json:"page_size"`
 }
 

+ 1 - 1
model/http_model/supplier_withdraw_list.go

@@ -4,7 +4,7 @@ type SupplierWithdrawListRequest struct {
 	SupplierId     int   `json:"supplier_id"`     // 服务商ID
 	WithdrawStatus int   `json:"withdraw_status"` // 提现状态:2提现中,3已提现,4已驳回
 	PageNum        int32 `json:"page_num"`
-	PageSize       int32 `json:"page_size"`
+	PageSize       int32 `json:"page"`
 }
 
 type SupplierWithdrawListData struct {

+ 22 - 5
service/s_local_life.go

@@ -563,7 +563,7 @@ func (*sLocalLife) CreateSpecialStrategy(ctx context.Context, request *http_mode
 func (*sLocalLife) GetFullSLocalBillList(ctx context.Context, req *http_model.FullSLocalBillListRequest) (*http_model.FullSLocalBillData, error) {
 
 	// 1. 查询本地生活任务基本信息
-	fullLocals, total, err := db.GetFullSLocalBillList(ctx, req.PageSize, req.PageNum, req.SupplierId)
+	fullLocals, total, err := db.GetFullSLocalBillList(ctx, req.PageSize, req.PageNum-1, req.SupplierId, req.LocalType, req.TaskStatus, req.LocalPlatform)
 	if err != nil {
 		logrus.WithContext(ctx).Errorf("[fullLocals service] call GetFullSLocalLifeList error,err:%+v", err)
 		return nil, err
@@ -629,7 +629,7 @@ func (*sLocalLife) FullSLocalTaskBillList(ctx context.Context, request *http_mod
 	currSLocalTaskBillData.DraftFeeSettle = 0
 
 	// 1. 查找子任务
-	taskList, total, taskListErr := db.GetSLocalTaskList(ctx, request.SLocalId, request.TalentId, request.PageSize, request.PageNum)
+	taskList, total, taskListErr := db.GetSLocalTaskList(ctx, request.SLocalId, request.Condition, request.PageSize, request.PageNum-1)
 	if taskListErr != nil {
 		return nil, taskListErr
 	}
@@ -639,7 +639,6 @@ func (*sLocalLife) FullSLocalTaskBillList(ctx context.Context, request *http_mod
 			var curr *http_model.FullSLocalTaskBillListData
 			curr = &http_model.FullSLocalTaskBillListData{}
 			curr.TaskId = task.TaskID
-			curr.ServiceCharge = task.ServiceCharge
 			curr.ViewNum = 0
 			curr.VoteNum = 0
 			curr.CommitNum = 0
@@ -647,9 +646,27 @@ func (*sLocalLife) FullSLocalTaskBillList(ctx context.Context, request *http_mod
 			curr.ServiceCharge = task.ServiceCharge
 			curr.DraftFee = task.DraftFee
 			curr.DelayRate = task.ScriptBreakRate + task.SketchBreakRate + task.LinkBreakRate + task.DataBreakRate
-			curr.RealServiceCharge = task.RealPayment - task.SettleAmount
+			if task.TaskStage < 15 {
+				curr.RealServiceCharge = 0
+			} else {
+				curr.RealServiceCharge = task.RealPayment - task.SettleAmount
+			}
+
 			curr.SettleAmount = task.SettleAmount
-			curr.SettleTime = conv.MustString(task.CompleteDate)
+			if task.CompleteDate != nil {
+				curr.SettleTime = conv.MustString(task.CompleteDate, "")
+			}
+
+			// 达人第三方平台信息
+			platformUserInfo, platformUserErr := db.FindUserInfoByOpenId(ctx, task.OpenID)
+			if platformUserErr != nil {
+				return nil, platformUserErr
+			}
+			if platformUserInfo != nil {
+				curr.TalentHeadUrl = platformUserInfo.HeadUri
+				curr.TalentNackName = platformUserInfo.NickName
+			}
+
 			currSLocalTaskBillData.DraftFee += curr.DraftFee
 			currSLocalTaskBillData.DraftFeeSettle += curr.SettleAmount
 			currSLocalTaskBillData.SLocalTaskList = append(currSLocalTaskBillData.SLocalTaskList, curr)

+ 21 - 4
service/s_project.go

@@ -639,7 +639,7 @@ func (*sProject) FullSProjectBillList(ctx context.Context, request *http_model.F
 	currSProjectBillData = &http_model.FullSProjectBillData{}
 
 	// 1. 根据SupplierId和账单状态查询数据
-	fullSProjectBillData, total, err := db.GetFullSProjectBillList(ctx, request.SupplierId, request.ProjectPlatform, request.ProjectStatus, request.PageSize, request.PageNum)
+	fullSProjectBillData, total, err := db.GetFullSProjectBillList(ctx, request.SupplierId, request.ProjectType, request.ProjectPlatform, request.ProjectStatus, request.PageSize, request.PageNum-1)
 	if err != nil {
 		return nil, err
 	}
@@ -700,7 +700,7 @@ func (*sProject) FullSProjectTaskBillList(ctx context.Context, request *http_mod
 	currSProjectTaskBillData.DraftFeeSettle = 0
 
 	// 1. 查找子任务
-	taskList, total, taskListErr := db.GetSProjectTaskList(ctx, request.SProjectId, request.TalentId, request.PageSize, request.PageNum)
+	taskList, total, taskListErr := db.GetSProjectTaskList(ctx, request.SProjectId, request.Condition, request.PageSize, request.PageNum-1)
 	if taskListErr != nil {
 		return nil, taskListErr
 	}
@@ -718,9 +718,26 @@ func (*sProject) FullSProjectTaskBillList(ctx context.Context, request *http_mod
 			curr.ServiceCharge = task.ServiceCharge
 			curr.DraftFee = task.DraftFee
 			curr.DelayRate = task.ScriptBreakRate + task.SketchBreakRate + task.LinkBreakRate + task.DataBreakRate
-			curr.RealServiceCharge = task.RealPayment - task.SettleAmount
+			if task.TaskStage < 15 {
+				curr.RealServiceCharge = 0
+			} else {
+				curr.RealServiceCharge = task.RealPayment - task.SettleAmount
+			}
 			curr.SettleAmount = task.SettleAmount
-			curr.SettleTime = conv.MustString(task.CompleteDate)
+			if task.CompleteDate != nil {
+				curr.SettleTime = conv.MustString(task.CompleteDate, "")
+			}
+
+			// 用户第三方平台信息
+			platformUserInfo, platformUserErr := db.FindUserInfoByOpenId(ctx, task.OpenId)
+			if platformUserErr != nil {
+				return nil, platformUserErr
+			}
+			if platformUserInfo != nil {
+				curr.TalentHeadUrl = platformUserInfo.HeadUri
+				curr.TalentNackName = platformUserInfo.NickName
+			}
+
 			currSProjectTaskBillData.DraftFee += curr.DraftFee
 			currSProjectTaskBillData.DraftFeeSettle += curr.SettleAmount
 			currSProjectTaskBillData.SProjectTaskList = append(currSProjectTaskBillData.SProjectTaskList, curr)

+ 6 - 5
service/supplier.go

@@ -430,7 +430,7 @@ func (*supplier) GetSupplierIncomeList(ctx context.Context, req *http_model.Full
 	sProjectIncomeData = &http_model.FullSProjectIncomeData{}
 
 	// 1. 查询
-	supplierIncome, total, err := db.GetSupplierIncomeList(ctx, req.PageSize, req.PageNum, req.SupplierId, req.IncomeStatus)
+	supplierIncome, total, err := db.GetSupplierIncomeList(ctx, req.PageSize, req.PageNum-1, req.SupplierId, req.IncomeStatus)
 	if err != nil {
 		return nil, nil
 	}
@@ -582,10 +582,10 @@ func (*supplier) CreateSupplierInvoice(ctx context.Context, req *http_model.Crea
 		InvoiceStatus: 1,
 		IncomeIds:     req.IncomeIds,
 	}
-	if req.SOperatorType == 1 {
+	if req.SubAccountId == 0 {
 		invoiceData.SOperatorType = 1
 		invoiceData.SOperator = req.SupplierId
-	} else if req.SOperatorType == 2 {
+	} else {
 		invoiceData.SOperatorType = 2
 		invoiceData.SOperator = req.SubAccountId
 	}
@@ -668,7 +668,7 @@ func (*supplier) UpdateSupplierIncomeStatus(ctx context.Context, incomeIds strin
 // GetSupplierInvoiceList 查找服务商发票列表
 func (*supplier) GetSupplierInvoiceList(ctx context.Context, req *http_model.SupplierInvoiceListRequest) (*http_model.SupplierInvoiceListData, error) {
 	// 1. 查询服务商发票信息
-	supplierInvoiceList, total, err := db.GetInvoiceListBySupplierId(ctx, req.SupplierId, req.InvoiceStatus, 4, req.PageSize, req.PageNum)
+	supplierInvoiceList, total, err := db.GetInvoiceListBySupplierId(ctx, req.SupplierId, req.InvoiceStatus, 4, req.PageSize, req.PageNum-1)
 	if err != nil {
 		return nil, err
 	}
@@ -739,7 +739,7 @@ func (*supplier) GetSupplierToWithdrawList(ctx context.Context, req *http_model.
 		// 企业服务商
 		if supplierInfo.SupplierType == 2 {
 			// 查询企业服务商发票信息
-			supplierInvoiceList, total, supplierInvoiceErr := db.GetInvoiceListBySupplierId(ctx, req.SupplierId, 3, 1, req.PageSize, req.PageNum)
+			supplierInvoiceList, total, supplierInvoiceErr := db.GetInvoiceListBySupplierId(ctx, req.SupplierId, 3, 1, req.PageSize, req.PageNum-1)
 			if supplierInvoiceErr != nil {
 				return nil, supplierInvoiceErr
 			}
@@ -1081,6 +1081,7 @@ func (*supplier) GetSupplierAmountBillList(ctx context.Context, req *http_model.
 		// supplierAmountList.SupplierAmountBillList = sProjectList
 
 		for _, billInfo := range sProjectList {
+			billInfo.AddToListOperator = conv.MustString(billInfo.SupplierId)
 			if billInfo.Type == 1 {
 				productInfo, productInfoErr := db.GetProductByID(ctx, int64(billInfo.ProductId))
 				if productInfoErr != nil {