Exemplo n.º 1
0
 /**
  * Check if subtotal qualifies for free catalog
  * @param $market_id
  * @param $subtotal
  * @return bool
  */
 public function catalogReward($market_id, $subtotal)
 {
     if (empty($market_id)) {
         return [false, 50];
     }
     if ($subtotal >= ProductGlobal::rewardVal()[$market_id]) {
         return [true, 0];
     } else {
         return [false, max(ProductGlobal::rewardVal()[$market_id] - $subtotal, 0)];
     }
 }