'integer', 'dl_count' => 'integer', 'size' => 'integer', 'scene' => 'integer', 'create_at' => 'datetime', 'update_at' => 'datetime', 'delete_at' => 'datetime' ]; /** * 添加附件记录 * @param array $data 附件数据 * @return int|bool */ public static function addAttachment($data) { $attachment = new self(); return $attachment->allowField(true)->save($data); } /** * 根据hash_key获取附件 * @param string $hashKey * @return array|null */ public static function getByHashKey($hashKey) { return self::where('hash_key', $hashKey) ->where('delete_at', null) ->find(); } }