__("Image"), "audio/*" => __("Audio"), "video/*" => __("Video"), "text/*" => __("Text"), "application/*" => __("Application"), "zip,rar,7z,tar" => __("Zip"), ]; return $data; } protected static function init() { // 如果已经上传该资源,则不再记录 self::beforeInsert(function ($model) { if (self::where('url', '=', $model['url'])->where(array('shop_id'=>$model['shop_id']))->where('storage', $model['storage'])->find()) { return false; } }); } }