|
|
|
@ -65,13 +65,14 @@ class UserService implements UserServiceInterface |
|
|
|
/** |
|
|
|
* @inheritDoc |
|
|
|
*/ |
|
|
|
public function isStoreFirstOrderToday($user_id, $store_id, $current_order_id) |
|
|
|
public function isStoreFirstOrderToday($user_id, $store_id, $current_order_id, $limit_amount = 3) |
|
|
|
{ |
|
|
|
return !Order::query() |
|
|
|
->where(['user_id' => $user_id, 'store_id' => $store_id]) |
|
|
|
->whereIn('dm_state', [OrderMain::ORDER_STATE_UNTAKE,OrderMain::ORDER_STATE_DELIVERY]) |
|
|
|
->where('time_add', '>=', date('Y-m-d 00:00:00')) |
|
|
|
->where('time_add', '<=', date('Y-m-d 23:59:59')) |
|
|
|
->where('money', '>=', $limit_amount) |
|
|
|
->where('id', '!=', $current_order_id) |
|
|
|
->exists(); |
|
|
|
} |