|
|
@@ -830,7 +830,8 @@ class OrderClass extends BaseClass
|
|
|
$data['payStatus'] = self::PAY_STATUS_UN_PAY;
|
|
|
$data['customId'] = !empty($data['customId']) ? $data['customId'] : 0;
|
|
|
$live = $data['live'] ?? 1;
|
|
|
- $shop = ShopClass::getLockById($shopId);
|
|
|
+ $currentShopId = $data['shopId'] ?? 0;
|
|
|
+ $shop = ShopClass::getLockById($currentShopId);
|
|
|
if (empty($shop)) {
|
|
|
util::fail('没有找到门店7');
|
|
|
}
|
|
|
@@ -878,7 +879,7 @@ class OrderClass extends BaseClass
|
|
|
//默认订单要打单
|
|
|
$data['needPrint'] = $data['needPrint'] ?? dict::getDict('needPrint', 'need');
|
|
|
|
|
|
- $weight = $respond['weight'];
|
|
|
+ $weight = $respond['weight'] ?? 0;
|
|
|
$data['weight'] = $weight;
|
|
|
$itemPrice = $respond['price'] ?? 0;
|
|
|
$data['itemPrice'] = $itemPrice;
|
|
|
@@ -1385,6 +1386,7 @@ class OrderClass extends BaseClass
|
|
|
|
|
|
if (isset($data['list']) && !empty($data['list'])) {
|
|
|
foreach ($data['list'] as $key => $val) {
|
|
|
+
|
|
|
//同个人同地址当天订单数
|
|
|
$sameTimeIds = $val['sameTimeIds'] ?? '';
|
|
|
$sameNum = 0;
|
|
|
@@ -2483,9 +2485,8 @@ class OrderClass extends BaseClass
|
|
|
//如果有限购数量占用,也需要清除
|
|
|
$customId = $order->customId ?? 0;
|
|
|
$num = floor($v['num']);
|
|
|
- if (!empty($customId) && $num > 0) {
|
|
|
- ProductClass::baseClearLimitBuy($v['productId'], $customId, $num);
|
|
|
- }
|
|
|
+ ProductClass::baseClearLimitBuy($v['productId'], $customId, $num);
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
return $order;
|
|
|
@@ -3106,12 +3107,7 @@ XL;
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 更新同天内的所有订单的 sameTimeIds
|
|
|
- * @param $order
|
|
|
- * @param $date 账单日期
|
|
|
- * @throws \Exception
|
|
|
- */
|
|
|
+ // 更新同天内的所有订单的 sameTimeIds
|
|
|
public static function updateSameTimeIds($order, $date)
|
|
|
{
|
|
|
$id = $order->id ?? 0;
|
|
|
@@ -3119,7 +3115,7 @@ XL;
|
|
|
$mainId = $order->mainId ?? 0;
|
|
|
$oldSameTimeIds = $order->sameTimeIds ?? '';
|
|
|
|
|
|
- //找到当前客户的账单日期为 $date 的所有订单,然后更新同天内的所有订单的 sameTimeIds(加此次要改变的订单的订单号$id)
|
|
|
+ //找到当前订单客户的账单日期为 $date 的所有订单,然后更新同天内的所有订单的 sameTimeIds(加此次要改变的订单的订单号$id)
|
|
|
$startTime = $date . ' 00:00:00';
|
|
|
$endTime = $date . ' 23:59:59';
|
|
|
$dayOrders = self::getAllByCondition([
|
|
|
@@ -3152,7 +3148,6 @@ XL;
|
|
|
}
|
|
|
|
|
|
//从原先同天内的订单中删除此次要改变的订单的订单号$id
|
|
|
-
|
|
|
if (!empty($oldSameTimeIds) && $oldSameTimeIds != $sameTimeIdsStr) {
|
|
|
$oldSameTimeIdsArr = explode(',', $oldSameTimeIds);
|
|
|
if (in_array($id, $oldSameTimeIdsArr)) {
|