feat : catering

This commit is contained in:
2025-03-11 17:52:13 +08:00
parent d9f52ac755
commit 08b6d7cda9
8 changed files with 624 additions and 8 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Service\ServiceTrait;
use App\Cache\Redis\Api\SiteCache;
use App\Constants\Admin\CateringCode;
use App\Constants\Common\OrderCode;
use App\Model\OrderMealCateringLog;
use App\Model\OrderOptionCateringLog;
@@ -77,7 +78,7 @@ trait CateringTrait
return;
}
if ($logInfo->status == 2) {
if ($logInfo->status == CateringCode::CATERING_STATUS_FINISH) {
$this->log->error(__CLASS__.':Function:refundCallBackHandle:manageSubOptionCateringLog:已经截单不需要修改,订单信息:'.json_encode($this->orderInfo->toArray()));
return;
}
@@ -107,7 +108,7 @@ trait CateringTrait
continue;
}
if ($logInfo->status == 2) {
if ($logInfo->status == CateringCode::CATERING_STATUS_FINISH) {
$this->log->error(__CLASS__.':Function:refundCallBackHandle:manageSubMealCateringLog:已经截单不需要修改,订单信息:'.json_encode($this->orderInfo->toArray()).':订单商品信息:'.json_encode($orderGoods));
continue;
}
@@ -143,10 +144,10 @@ trait CateringTrait
$logInfo->kitchen_id = (int)$siteInfo['kitchen_id'];
$logInfo->quantity = 0;
$logInfo->add_staple_food_num = 0;
$logInfo->status = 1;
$logInfo->status = CateringCode::CATERING_STATUS_UNDERWAY;
}
if ($logInfo->status == 2) return false;
if ($logInfo->status == CateringCode::CATERING_STATUS_FINISH) return false;
$logInfo->quantity = $logInfo->quantity + $this->orderInfo->copies;
$logInfo->add_staple_food_num = $this->orderInfo->add_staple_food_num + $addStapleFoodNum;
@@ -174,10 +175,10 @@ trait CateringTrait
$logInfo->cycle_id = $this->orderInfo->cycle_id;
$logInfo->sku_id = (int)$key;
$logInfo->quantity = 0;
$logInfo->status = 1;
$logInfo->status = CateringCode::CATERING_STATUS_UNDERWAY;
}
if ($logInfo->status == 2) return false;
if ($logInfo->status == CateringCode::CATERING_STATUS_FINISH) return false;
$logInfo->quantity = $logInfo->quantity + $orderGood;