|
@@ -90,7 +90,7 @@ func (e *Waybill) GetUserPage(c *dto.WaybillGetPageReq, list *[]model.Waybill, c
|
|
|
cDto.MakeCondition(c.GetNeedSearch()),
|
|
|
cDto.Paginate(c.GetPageSize(), c.GetPageIndex()),
|
|
|
).
|
|
|
- Where("delivery_id = ? or re_check_id = ?", p.UserId, p.UserId).
|
|
|
+ Where("delivery_id = ? or re_check_id = ? or create_by = ?", p.UserId, p.UserId, p.UserId).
|
|
|
Preload("CoolerBox").
|
|
|
Preload("Delivery").
|
|
|
Preload("ReCheck").
|
|
@@ -559,7 +559,7 @@ func (e *Waybill) Delivery(c *dto.WaybillDeliveryReq, p *actions.DataPermission)
|
|
|
res, err1 := ss.SmsXSend(waybillModel.ConsigneeAddressPhone, addr)
|
|
|
if err1 != nil || res.Status != sms.SUCCESS {
|
|
|
e.Log.Errorf("派单短信发送失败", zap.Any("res", res), zap.Error(err1))
|
|
|
- err = errors.New("派单短信发送失败,请重试")
|
|
|
+ err = errors.New("派单短信发送失败,请检查收件人电话是否正确!")
|
|
|
return err
|
|
|
}
|
|
|
waybillModel.SendLog = model.WaybillSendLog{
|
|
@@ -830,7 +830,7 @@ func (e *Waybill) GetBasicsStats(c *dto.WaybillStatsReq, p *actions.DataPermissi
|
|
|
|
|
|
if c.Type == "month" {
|
|
|
// 获取上个月第一天
|
|
|
- month, _ := time.Parse("2006-01", c.Date)
|
|
|
+ month, _ := time.ParseInLocation("2006-01", c.Date,time.Local)
|
|
|
firstDayOfMonth := time.Date(month.Year(), month.Month(), 1, 0, 0, 0, 0, now.Location())
|
|
|
lastDayOfMonth := time.Date(month.Year(), month.Month()+1, 1, 23, 59, 59, 0, now.Location()).Add(-time.Hour * 24)
|
|
|
e.Orm.Model(&data).Select("date_format(order_time,'%Y-%m-%d') date,count(1) as num ").Scopes(actions.Permission(data.TableName(), p)).
|
|
@@ -907,7 +907,7 @@ func GetUserBasicsStatsScopes(userId int) func(db *gorm.DB) *gorm.DB {
|
|
|
if userId == 0 {
|
|
|
return db
|
|
|
}
|
|
|
- return db.Where("delivery_id = ? or re_check_id = ? ", userId, userId)
|
|
|
+ return db.Where("delivery_id = ? or re_check_id = ? or create_by = ?", userId, userId, userId)
|
|
|
}
|
|
|
}
|
|
|
func (e *Waybill) GetUserBasicsStats(c *dto.WaybillStatsReq, p *actions.DataPermission, scopes func(*gorm.DB) *gorm.DB) dto.WaybillStatsRes {
|
|
@@ -985,7 +985,7 @@ func (e *Waybill) GetUserBasicsStats(c *dto.WaybillStatsReq, p *actions.DataPerm
|
|
|
|
|
|
if c.Type == "month" {
|
|
|
// 获取上个月第一天
|
|
|
- month, _ := time.Parse("2006-01", c.Date)
|
|
|
+ month, _ := time.ParseInLocation("2006-01", c.Date,time.Local)
|
|
|
firstDayOfMonth := time.Date(month.Year(), month.Month(), 1, 0, 0, 0, 0, now.Location())
|
|
|
lastDayOfMonth := time.Date(month.Year(), month.Month()+1, 1, 23, 59, 59, 0, now.Location()).Add(-time.Hour * 24)
|
|
|
e.Orm.Model(&data).Select("date_format(order_time,'%Y-%m-%d') date,count(1) as num ").Scopes(actions.Permission(data.TableName(), p), scopes).
|
|
@@ -1021,7 +1021,7 @@ func (e *Waybill) GetUserStats(c *dto.WaybillUserStatsReq, p *actions.DataPermis
|
|
|
|
|
|
if c.Type == "month" {
|
|
|
// 获取上个月第一天
|
|
|
- month, _ := time.Parse("2006-01", c.Date)
|
|
|
+ month, _ := time.ParseInLocation("2006-01", c.Date,time.Local)
|
|
|
firstDayOfMonth := time.Date(month.Year(), month.Month(), 1, 0, 0, 0, 0, now.Location())
|
|
|
lastDayOfMonth := time.Date(month.Year(), month.Month()+1, 1, 23, 59, 59, 0, now.Location()).Add(-time.Hour * 24)
|
|
|
e.Orm.Model(&data).Select("date_format(order_time,'%Y-%m-%d') date,count(1) as num ").Scopes(actions.Permission(data.TableName(), p), scopes).
|