diff --git a/app/Controller/Admin/MealCateringController.php b/app/Controller/Admin/CateringController.php similarity index 72% rename from app/Controller/Admin/MealCateringController.php rename to app/Controller/Admin/CateringController.php index b59da93..8384b20 100644 --- a/app/Controller/Admin/MealCateringController.php +++ b/app/Controller/Admin/CateringController.php @@ -16,7 +16,7 @@ use Hyperf\Validation\Annotation\Scene; #[Middlewares([ JwtAuthMiddleware::class, ])] -class MealCateringController +class CateringController { #[RequestMapping(path: "meal/cycle_list", methods: "GET")] #[Scene(scene: "meal_cycle_list")] @@ -32,5 +32,17 @@ class MealCateringController return(new OptionCycleListService)->handle(); } + #[RequestMapping(path: "meal/remain_count", methods: "GET")] + #[Scene(scene: "meal_remain_count")] + public function remainMealCateringCount() + { + } + + #[RequestMapping(path: "option/remain_count", methods: "GET")] + #[Scene(scene: "option_remain_count")] + public function remainOptionCateringCount() + { + + } } diff --git a/app/Service/ServiceTrait/Admin/CouponDispenseTrait.php b/app/Service/ServiceTrait/Admin/CouponDispenseTrait.php index 659bd55..e29dea5 100644 --- a/app/Service/ServiceTrait/Admin/CouponDispenseTrait.php +++ b/app/Service/ServiceTrait/Admin/CouponDispenseTrait.php @@ -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']); } /**