예제 #1
0
파일: Map.php 프로젝트: zedx/core
 /**
  * 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();
 }
예제 #2
0
파일: helpers.php 프로젝트: zedx/core
 /**
  * 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;
 }