|
|
@@ -1,13 +1,16 @@ |
|
|
|
package svc |
|
|
|
|
|
|
|
import ( |
|
|
|
enum3 "applet/app/admin/enum" |
|
|
|
"applet/app/admin/md" |
|
|
|
svc4 "applet/app/admin/svc" |
|
|
|
svc "applet/app/admin/svc/enterprise_manage" |
|
|
|
enum2 "applet/app/customer/enum" |
|
|
|
md2 "applet/app/customer/md" |
|
|
|
svc2 "applet/app/customer/svc" |
|
|
|
"applet/app/db" |
|
|
|
model2 "applet/app/db/model" |
|
|
|
"applet/app/e" |
|
|
|
"applet/app/enum" |
|
|
|
svc3 "applet/app/svc" |
|
|
|
"applet/app/utils" |
|
|
@@ -21,7 +24,7 @@ import ( |
|
|
|
"time" |
|
|
|
) |
|
|
|
|
|
|
|
func CentralKitchenForSchoolOrderRefundList(req md.CentralKitchenForSchoolOrderRefundListReq) (resp []md.CentralKitchenForSchoolOrderRefundListResp, total int64, err error) { |
|
|
|
func CentralKitchenForSchoolOrderRefundList(c *gin.Context, req md.CentralKitchenForSchoolOrderRefundListReq) (resp []md.CentralKitchenForSchoolOrderRefundListResp, total int64, err error) { |
|
|
|
var m []*db.CentralKitchenForSchoolUserRefundDayWithData |
|
|
|
sess := db.Db.Where("1=1") |
|
|
|
if req.EnterpriseId != 0 { |
|
|
@@ -137,6 +140,24 @@ func CentralKitchenForSchoolOrderRefundList(req md.CentralKitchenForSchoolOrderR |
|
|
|
if len(classWithUserIdentityIdsTwo) > 0 { |
|
|
|
sess.In("user_identity.id", classWithUserIdentityIdsTwo) |
|
|
|
} |
|
|
|
admin := svc4.GetUser(c) |
|
|
|
if admin.IsSuperAdministrator != enum3.IsSuperAdministratorTure { |
|
|
|
adminWithEnterpriseDb := db.AdminWithEnterpriseDb{} |
|
|
|
adminWithEnterpriseDb.Set() |
|
|
|
adminWithEnterprise, err1 := adminWithEnterpriseDb.FindAdminWithEnterprise(admin.AdmId) |
|
|
|
if err1 != nil { |
|
|
|
e.OutErr(c, e.ERR_DB_ORM, err1.Error()) |
|
|
|
return |
|
|
|
} |
|
|
|
var enterPriseIds []int |
|
|
|
for _, v1 := range *adminWithEnterprise { |
|
|
|
enterPriseIds = append(enterPriseIds, v1.EnterpriseId) |
|
|
|
} |
|
|
|
if len(enterPriseIds) == 0 { |
|
|
|
return |
|
|
|
} |
|
|
|
sess.In("central_kitchen_for_school_user_with_day.enterprise_id", enterPriseIds) |
|
|
|
} |
|
|
|
|
|
|
|
total, err = sess. |
|
|
|
Join("LEFT", "central_kitchen_for_school_user_with_day", "central_kitchen_for_school_user_refund_day.records_id = central_kitchen_for_school_user_with_day.id"). |
|
|
|