feat : catering

This commit is contained in:
2025-03-10 17:41:43 +08:00
parent 2e67b921bd
commit 11b0782568
2 changed files with 33 additions and 9 deletions

View File

@@ -25,15 +25,25 @@ trait CouponDispenseTrait
$this->cycleId = $cycleInfo->id;
if ($this->groupType == CouponCode::DISPENSE_APPOINT_GROUP_DESIGNATED_SITES_AND_GOODS) {
$appointValue = json_encode($this->request->input('appoint_value'));
$this->appointValue = [
$appointValue = json_encode($this->request->input('appoint_value'));
// if ($this->groupType == CouponCode::DISPENSE_APPOINT_GROUP_DESIGNATED_SITES_AND_GOODS) {
// $this->appointValue = [
// 'site' => explode(',', $appointValue['site']),
// 'sku' => explode(',', $appointValue['goods'])
// ];
// } else {
// $this->appointValue = explode(',', $this->request->input('appoint_value'));
// }
//
match ($this->groupType){
CouponCode::DISPENSE_APPOINT_GROUP_DESIGNATED_USERS => $this->appointValue = explode(',', $appointValue['user_ids']),
CouponCode::DISPENSE_APPOINT_GROUP_DESIGNATED_SITES => $this->appointValue = explode(',', $appointValue['site']),
CouponCode::DISPENSE_APPOINT_GROUP_DESIGNATED_GOODS => $this->appointValue = explode(',', $appointValue['goods']),
CouponCode::DISPENSE_APPOINT_GROUP_DESIGNATED_SITES_AND_GOODS => $this->appointValue = [
'site' => explode(',', $appointValue['site']),
'sku' => explode(',', $appointValue['goods'])
];
} else {
$this->appointValue = explode(',', $this->request->input('appoint_value'));
}
]
};
unset($cycleInfo);
}
@@ -142,7 +152,9 @@ trait CouponDispenseTrait
{
$this->checkAppointValue();
return explode(',',$this->request->input('appoint_value'));
$appointValue = json_encode($this->request->input('appoint_value'));
return explode(',', $appointValue['user_ids']);
}
/**