本文整理汇总了PHP中app\models\Currency::exchangeRates方法的典型用法代码示例。如果您正苦于以下问题:PHP Currency::exchangeRates方法的具体用法?PHP Currency::exchangeRates怎么用?PHP Currency::exchangeRates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Currency
的用法示例。
在下文中一共展示了Currency::exchangeRates方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionMyAdverts
public function actionMyAdverts()
{
if (Currency::find()->where(['>', 'date', time()])->orderBy(['date' => SORT_DESC])->asArray()->one() == null) {
$currency = new Currency();
if ($currency->exchangeRates()) {
Yii::$app->session->setFlash('warning', 'Exchange rates might differ from actual ones');
}
}
$searchModel = new AdvertSearch();
$dataProvider = $searchModel->getMyAdverts();
return $this->render('my-adverts', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
}
示例2: actionMyBookmarks
public function actionMyBookmarks()
{
if (Currency::find()->where(['>', 'date', time()])->orderBy(['date' => SORT_DESC])->asArray()->one() == null) {
$currency = new Currency();
if ($currency->exchangeRates()) {
Yii::$app->session->setFlash('warning', 'Exchange rates might differ from actual ones');
}
}
$disabled_subcat = 'disabled';
$disabled_city = 'disabled';
$catList = ArrayHelper::map(Category::find()->asArray()->all(), 'id', 'name');
$regionList = ArrayHelper::map(Region::find()->asArray()->all(), 'id', 'name');
$subcatList = [];
$cityList = [];
$searchModel = new BookmarkSearch();
$dataProvider = $searchModel->getMyBookmarks();
$advert = new Advert();
return $this->render('my-bookmarks', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'catList' => $catList, 'subcatList' => $subcatList, 'regionList' => $regionList, 'cityList' => $cityList, 'disabled_subcat' => $disabled_subcat, 'disabled_city' => $disabled_city, 'advert' => $advert]);
}