cycleId = (int)$this->initTodayCycleId(); $this->cartFirstData = []; $this->cartSecondData = []; $this->skuArr = []; $this->goodIds = []; $this->copies = 0; $this->couponId = 0; $this->siteId = 0; $this->orderRes = [ 'total_price' => '0.00', //总价 'total_good_price' => '0.00', //商品总价 'favorable_good_price' => '0.00', //商品优惠价格 'good_after_discount_price' => '0.00', //商品优惠后价格 'total_sundry_price' => '0.00', //服务总费用 'sundry_price' => '0.00', //服务费单价 'sundry_num' => 0, //服务费数量 'favorable_sundry_price' => '0.00', //服务费优惠价格 'sundry_after_discount_price' => '0.00', //服务费优惠后价格 'actual_price' => '0.00', //实际支付价格 'coupon_id' => 0, 'coupon' => [], 'site_id' => 0, 'site' => [], 'good_ids' => [], 'good' => [], 'optional_copies' => 0, 'meal_copies' => 0, ]; } /** * 检测 * @return void * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ public function check(): void { $kitchenId = $this->checkSite($this->siteId); $this->getGoodInfo($kitchenId); $this->buildCartData($this->request->input('cart')); $this->checkGood(); $this->checkStock(); } /** * 计算 * @return void * @throws ContainerExceptionInterface * @throws NotFoundExceptionInterface */ public function compute(): void { $this->computePrice(); $this->computeSundryPrice(); $this->computeFavorable(); $this->computeFinallyPrice(); } }