feat : coupon

This commit is contained in:
2025-03-21 16:15:28 +08:00
parent 11a36ece80
commit 8a4674b1dc
11 changed files with 190 additions and 11 deletions

View File

@@ -159,7 +159,7 @@ class CateringService extends CateringBaseService
$this->logInfo->status = CateringCode::CATERING_STATUS_FINISH;
if (!$this->logInfo->save()) throw new Exception('配餐失败1');
if (!$this->orderModel->isCateringByOrderIds($this->orderIds)) throw new Exception('配餐失败2');
if (!$this->orderModel->isCateringByOrderIds($this->orderIds) || !$this->orderGoodModel->isCateringByOrderIds($this->orderIds)) throw new Exception('配餐失败2');
Db::commit();
@@ -190,7 +190,7 @@ class CateringService extends CateringBaseService
$currentDate = date('Y-m-d H:i:s');
foreach ($this->orderList as &$order) {
foreach ($order['copies_list'] as &$copiesItem) {
if ($currentCode % $this->printBoxMaxNum === 0) {
if ($currentCode / $this->printBoxMaxNum === 0) {
$startCode = $currentCode + 1;
$endCode = min($currentCode + $this->printBoxMaxNum, $this->totalCopies);
$codeGroups = $this->splitArrayIntoPartitions(range($startCode, $endCode));