12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- namespace app\common\server;
-
- use app\common\model\dev\DevRegion;
-
- class AreaServer
- {
-
-
- public static function getAddress($val, $address = '')
- {
- $region = cache('region');
- if(!$region) {
- $region = DevRegion::column('id,name', 'id');
- cache('region', $region, 3600);
- }
-
- if(is_array($val)) {
- $temp = '';
- foreach($val as $v) {
- $temp .= $region[$v] ? $region[$v]['name'] : '';
- }
- return $temp.$address;
- }
-
- return $region[$val] ? $region[$val]['name'] : '';
- }
-
-
-
- public static function getDb09LngAndLat($id)
- {
- return Db::name('dev_region')
- ->where('id', '=', $id)
- ->field(['db09_lng', 'db09_lat'])
- ->find();
- }
- }
|