'正常', self::STATUS_PAUSE => '暂停', ]; public function setting() { return $this->hasOne(AreaSetting::class); } public function getAreaFenceAttribute($value) { return js2php($value); } public function getAreaCentreAttribute($value) { return js2php($value); } public function scopeActive($query) { return $query->where('status', self::STATUS_OK); } public static function byIdGetMerchantId($id) { if (CacheMap::IS_OPEN_DB_CACHE) { return Cache::remember(CacheMap::DB . "AreaModel:byIdGetMerchantId:" . $id, Carbon::now()->addHours(24), function () use ($id) { return self::where('id', $id)->value('merchant_id'); }); } return self::where('id', $id)->value('merchant_id'); } }