|
|
@ -35,7 +35,7 @@ class UserService implements UserServiceInterface |
|
|
public function isStoreFirstOrderToday($userId, $storeId, $currentOrderId, $limitAmount = 3) |
|
|
public function isStoreFirstOrderToday($userId, $storeId, $currentOrderId, $limitAmount = 3) |
|
|
{ |
|
|
{ |
|
|
return !Order::query() |
|
|
return !Order::query() |
|
|
->join('lanzu_order_main as main', 'main.id', '=', 'lanzu_order.order_main_id') |
|
|
|
|
|
|
|
|
->join('lanzu_order_main as main', 'main.global_order_id', '=', 'lanzu_order.order_main_id') |
|
|
->where(['main.user_id' => $userId, 'lanzu_order.store_id' => $storeId, 'main.type' => OrderType::OFFLINE]) |
|
|
->where(['main.user_id' => $userId, 'lanzu_order.store_id' => $storeId, 'main.type' => OrderType::OFFLINE]) |
|
|
->whereIn('main.state', OrderState::FINISH) |
|
|
->whereIn('main.state', OrderState::FINISH) |
|
|
->where('lanzu_order.created_at', '>=', strtotime(date('Y-m-d 00:00:00'))) |
|
|
->where('lanzu_order.created_at', '>=', strtotime(date('Y-m-d 00:00:00'))) |
|
|
|