Compare commits

...

6 Commits

Author SHA1 Message Date
f7e6b9c418 fix : order list 2025-08-07 16:13:59 +08:00
ea08aa94a6 fix : auto coupon 2025-08-06 21:37:30 +08:00
fdb5d99214 fix : order 2025-08-06 17:58:50 +08:00
b202835205 fix : order 2025-08-06 17:43:26 +08:00
44a500df9f fix : date 2025-08-06 17:24:43 +08:00
1a962ecb39 fix : date 2025-08-06 17:22:10 +08:00
5 changed files with 30 additions and 5 deletions

View File

@@ -68,6 +68,18 @@ class OrderListService extends BaseService
->when($this->request->input('search_kitchen_id'), function ($query) {
$query->where('kitchen_id', $this->request->input('search_kitchen_id'));
})
->when($this->request->input('search_order_sno'), function ($query) {
$searchOrderSno = $this->request->input('search_order_sno');
$query->where('order_sno', 'like', "$searchOrderSno%");
})
->when($this->request->input('search_create_time'), function ($query) {
$searchCreateTime = $this->request->input('search_create_time');
$query->whereBetween('create_time', [reset($searchCreateTime), end($searchCreateTime)]);
})
->when($this->request->input('search_pay_time'), function ($query) {
$searchPayTime = $this->request->input('search_pay_time');
$query->whereBetween('pay_time', [reset($searchPayTime), end($searchPayTime)]);
})
->select([
'id',
'cycle_id',

View File

@@ -47,7 +47,7 @@ class FinancesService extends BaseService
->when($searchKitchenId, function ($query) use ($searchKitchenId) {
$query->where('kitchen_id', $searchKitchenId);
})
->groupBy('cycle_id')
->groupBy('cycle_id','date')
->orderByDesc('cycle_id')
->select(
'date',

View File

@@ -72,7 +72,20 @@ class ConfirmationOrderService extends BaseOrderService
foreach ($filtered as &$value) {
$value['amount'] = match ($value['coupon_type']) {
CouponCode::COUPON_TYPE_INSTANT_REDUCTION => $value['amount'],
CouponCode::COUPON_TYPE_DISCOUNT => bcmul(bcsub("1", (string)$value['ratio'],2),(string)$orderMaxPrice,2),
// CouponCode::COUPON_TYPE_DISCOUNT => bcmul(bcsub("100", (string)$value['ratio'],2),(string)$orderMaxPrice,2),
CouponCode::COUPON_TYPE_DISCOUNT => bcmul(
bcdiv(
bcsub(
"100",
(string)$value['ratio'],
2
),
"100",
2
),
bcadd((string)max(array_column($this->orderRes['good'],'price')),(string)$this->orderRes['sundry_price'],2),
2
),
default => 0
};

View File

@@ -156,11 +156,11 @@ class OrderInfoService extends BaseService
for ($i = 1; $i <= (count($newOrderSkuList) ?? 0); $i++) {
$pickupCodeOneCopies = $pickupCodeArrList[$order['id']][$i]['pickup_code'] ?? null;
$pickupCodeOneCopies = $pickupCodeList[$i] ?? null;
$boxNum = 0;
if (!empty($pickupCodeOneCopies)) {
$pickupCodeOneCopiesArr = explode('-', $pickupCodeOneCopies);
$boxNum = ceil(end($pickupCodeOneCopiesArr) ?? '0' / (int)$this->configCache->getConfigValueByKey(ConfigCode::MAXIMUM_VALUE_IN_FULL_BOX));
$boxNum = ceil((int)(end($pickupCodeOneCopiesArr) ?? 0) / (int)$this->configCache->getConfigValueByKey(ConfigCode::MAXIMUM_VALUE_IN_FULL_BOX));
}
$oneCopiesInfo = [

View File

@@ -184,7 +184,7 @@ class OrderListService extends BaseService
$boxNum = 0;
if (!empty($pickupCodeOneCopies)) {
$pickupCodeOneCopiesArr = explode('-', $pickupCodeOneCopies);
$boxNum = ceil(end($pickupCodeOneCopiesArr) ?? '0' / (int)$this->configCache->getConfigValueByKey(ConfigCode::MAXIMUM_VALUE_IN_FULL_BOX));
$boxNum = ceil((int)(end($pickupCodeOneCopiesArr) ?? 0) / (int)$this->configCache->getConfigValueByKey(ConfigCode::MAXIMUM_VALUE_IN_FULL_BOX));
}
$oneCopiesInfo = [
'total_price' => '0.00',