| 123456789101112131415161718192021222324 |
- <?php
- namespace app\models\system;
- use crmeb\traits\ModelTrait;
- use crmeb\basic\BaseModel;
- use think\facade\Cache;
- class DictCoin extends BaseModel
- {
- use ModelTrait;
- public static function getIcon($symbol)
- {
- $icon = Cache::get('icon_' . $symbol);
- if ($icon) {
- return $icon;
- }
- $icon = self::where('symbol', $symbol)->value('icon');
- Cache::set('icon_' . $symbol, $icon, 86400);
- return $icon;
- }
- }
|