where([['type', '=', $value]]); } } public function getValueAttr($value, $data) { if ($data['type'] == WechatMediaDict::NEWS) { return json_decode($value, true); } else { return $value; } } }