/** * Determine whether the given status same with the current module status. * * @param $status * * @return bool */ public function isStatus($status) { return (bool) Country::whereCode($this->getCode())->whereIsActivate($status)->count(); }
/** * Get ad currency. * * @param Ad $ad * @param string $unit * * @return string */ function getAdCurrency($ad, $unit) { if ($unit != '{currency}') { return $unit; } $default = setting('default_ad_currency'); $countryCode = $ad->geolocation->country; if (!$countryCode) { return $default; } $country = Country::whereCode($countryCode)->first(); if ($country) { return $country->currency_symbole ?: $country->currency; } return $default; }