Skip to content

Commit

Permalink
fix(api withdraw): batch item approving issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sabbir1991 committed Apr 25, 2018
1 parent 2a57eff commit bdbcf39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/api/class-withdraw-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ public function register_routes() {
'permission_callback' => array( $this, 'batch_items_permissions_check' ),
'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),
),
'schema' => array( $this, 'get_public_batch_schema' ),
) );
}

Expand Down Expand Up @@ -481,7 +480,8 @@ public function batch_items( $request ) {
$status_code = $this->get_status( $status );
$user = $wpdb->get_row( "SELECT user_id, amount FROM {$wpdb->prefix}dokan_withdraw WHERE id = {$withdraw_id}" );

if ( dokan_get_seller_balance( $user->user_id, false ) < $user->amount ) {

if ( $status_code === 1 && dokan_get_seller_balance( $user->user_id, false ) < $user->amount ) {
continue;
}

Expand Down

0 comments on commit bdbcf39

Please sign in to comment.