<?php

namespace app\admin\model;

use app\BaseModel;

class CountryLanguages extends BaseModel
{
    protected $autoWriteTimestamp = true;
    protected $createTime = 'created_at';
    protected $updateTime = 'updated_at';
    public static function getAreaCode($language_code='en')
    {
        $country_codes = CountryLanguages::where('language_code', $language_code)
                ->order('sort', 'desc')
                ->field(['area_code as code','country_name as name'])
                ->select();
        return $country_codes;
    }
}