12345678910111213141516171819202122232425262728 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Mead
- * Date: 2019/9/4
- * Time: 9:36 AM
- */
- namespace App\Models;
- trait AreaTraitModel
- {
- // public static $redis = new \Redis();
- private static $redis_areas_tags = 'areas';
- public function byAreaIdGetArea($area_id)
- {
- $area = $this->redis->hget(self::$redis_areas_tags, $area_id);
- if ($area) {
- $area = unserialize($area);
- $area['area_fence'] = json_decode($area['area_fence'], true);
- $area['area_centre'] = json_decode($area['area_centre'], true);
- $area['area_fushe_fence'] = json_decode($area['area_fushe_fence'], true);
- return $area;
- }
- return false;
- }
- }
|