This commit is contained in:
@@ -175,6 +175,7 @@ func GetDeliveryDetails(c *gin.Context) {
|
|||||||
"total_prix": command["total_prix"],
|
"total_prix": command["total_prix"],
|
||||||
"referral_used": command["referral_used"],
|
"referral_used": command["referral_used"],
|
||||||
"created_at": command["created_at"],
|
"created_at": command["created_at"],
|
||||||
|
"is_new_client": isFirstOrder(command["client_order_number"]),
|
||||||
"client_info": clientInfo,
|
"client_info": clientInfo,
|
||||||
"items": itemsSummary,
|
"items": itemsSummary,
|
||||||
"items_count": len(items),
|
"items_count": len(items),
|
||||||
@@ -625,3 +626,9 @@ func GetMyDeliveryStats(c *gin.Context) {
|
|||||||
"today_revenue": todayRow.Revenue,
|
"today_revenue": todayRow.Revenue,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// isFirstOrder indique si la commande est la toute première du client (client_order_id == 1).
|
||||||
|
func isFirstOrder(v any) bool {
|
||||||
|
n, _ := strconv.Atoi(fmt.Sprintf("%v", v))
|
||||||
|
return n == 1
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user