コード例 #1
0
ファイル: SettingController.php プロジェクト: zedx/core
 /**
  * Show the form for editing the specified resource.
  *
  * @return Response
  */
 public function index()
 {
     $setting = setting();
     $currencies = Country::distinct()->where('currency', '<>', '')->groupBy('currency')->lists('currency')->toArray();
     $languages = $this->getLanguages();
     return view_backend('setting.index', compact('setting', 'currencies', 'languages'));
 }
コード例 #2
0
ファイル: MapsRepository.php プロジェクト: zedx/core
 /**
  * Get maps by status.
  *
  * @param $status
  *
  * @return array
  */
 public function getByStatus($status)
 {
     $maps = [];
     $enabled = Country::enabled()->lists('code')->toArray();
     foreach ($this->all() as $code => $map) {
         if (in_array($code, $enabled) === $status) {
             $maps[$code] = $map;
         }
     }
     return $maps;
 }
コード例 #3
0
ファイル: GatewayController.php プロジェクト: zedx/core
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $gateways = Gateway::paginate(10);
     $currencies = Country::distinct()->where('currency', '<>', '')->groupBy('currency')->lists('currency')->toArray();
     return view_backend('gateway.index', compact('gateways', 'currencies'));
 }
コード例 #4
0
ファイル: CountryController.php プロジェクト: zedx/core
 /**
  * Update country currency symbole.
  *
  * @param CountryUpdateSymboleRequest $request
  * @param Country                     $country
  *
  * @return Response
  */
 public function updateSymbole(CountryUpdateSymboleRequest $request, Country $country)
 {
     $country->currency_symbole = $request->symbole;
     $country->save();
 }
コード例 #5
0
ファイル: CountryTableSeeder.php プロジェクト: zedx/core
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $countries = $this->getCountries();
     Country::insert($countries);
 }
コード例 #6
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();
 }
コード例 #7
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;
 }